Kevin Dangoor wrote:
> ugh. At one point, I had checked in the .egg-info directory, but then
> people complained about getting conflicts there.
>
> try
>
> python setup.py egg_info
>
> and then rerun the develop command.
That's not gonna work. See below.
> > asimov:~/turbogears jeremy$ sudo python setup.py develop
> > --script-dir=/usr/local/bin
> > Traceback (most recent call last):
> > File "setup.py", line 14, in ?
> > from docgen import GenSite
> > File "/Users/jeremy/turbogears/docgen.py", line 7, in ?
> > pkg_resources.require("Kid >= 0.6.4")
Your setup script imports docgen, which in turn runs the require().
Modules really shouldn't require() in this way.
But you're not entirely at fault; the key problems here are that:
1. A project that hasn't run egg_info is essentially broken
2. A project that has its source code in the project root (as opposed
to a lib or src subdirectory) is always on sys.path
If you change either of these things, the problem goes away. Using a
subdirectory makes it go away altogether.I hadn't actually thought
about this before, it's just that my projects usually have a 'src'
directory, so I haven't run into this issue. Plus it only happens when
you start a project, unless you're a user working from a checkout.
Users working from an sdist never see an issue.
The only other thing I can think of to do is to force the setup script
to *remove* the project egg from the working set, or perhaps forcibly
set its version number! This won't take it off sys.path, of course,
nor would it necessarily be the *right* version number (due to egg_info
not having been run yet), but it would fix the brokenness and end the
"include .egg-info or not include .egg-info" debate. :)
I'd also have to change egg_info to ajust the version number of the
in-memory distribution object, but that's not a big deal. Looks like
the final 0.6a8 release is going to be the "Subversion development"
release - so far most of the features and bugfixes in 0.6a8 are to
support users who are tracking the Subversion release of a project, or
sdist snapshots thereof.