[TIP] py.test plugin: setuptools problems

Geoff Bache geoff.bache at gmail.com
Wed Mar 9 13:19:19 PST 2011

Hi all, (Holger especially...)

I'm trying to write a minimal py.test plugin to go with a new package
I'm writing, and am having loads of trouble making the setuptools
aspect of it work. As I understand it, I have to define a "setuptools
entry point" for it in order for py.test to find it.

As there's currently only five lines of it it seems somewhat overkill
to have a completely separate package for it - would seem easier to
just check it in with my package (which doesn't use setuptools
currently) and have a separate setup operation for it. I'm having a
lot of trouble making that work though.

So, my questions/requests :
1) I would love to have a way to write a py.test plugin that didn't
require using setuptools. I find it complex, hard to use and poorly
documented, and every new egg makes our sys.path even longer and all
our Python programs slower...
2) Any guesses why setuptools would be installing every Python file it
could find under the current working directory in this new "egg"? I
have specified "py_modules" to a single file, but still get everything
(basically a duplicate copy of the whole 'real' package).
3) Is there any way to tell setuptools not to make an egg? Or even to
just create an "entry point" without installing anythiing? All I want
is for my 5 lines of python to appear in a nice simple .py file
somewhere it can be imported :)


More information about the testing-in-python mailing list