twisted / nevow

Web Application Construction Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nevow cannot be installed with pip into a clean virtualenv

nevow-migration opened this issue · comments

The problem is that Nevow imports nevow._version in setup.py which imports twisted. In the setuptools world Nevow should put "twisted" in setup_requires, but setup_requires doesn't actually work with pip because the first thing pip does on downloading is run setup.py egg_info which doesn't work if Twisted is not installed...


Imported from Launchpad using lp2gh.

(by mwhudson)
This is harder than I thought, because setup.py imports nevow and nevow/init.py imports nevow/_version.py which imports twisted.python.versions and pip doesn't seem to support setup_requires.

versiontools has a way of doing this sort of thing that doesn't require setup_requires: http://versiontools.readthedocs.org/en/latest/usage.html -- maybe Nevow could use that or something similar?

(by mithrandi)
I believe pip does support setup_requires, but your setup.py needs to be executable without those dependencies available for pip (or anything else) to actually run it to determine values such as setup_requires. I think the install-time import of nevow is kinda icky, so it would be nice to avoid this.

(by mithrandi)
aaaaand... this is apparently a dup of bug #812537.

(by mithrandi)
Okay actually, I take that back; the secondary issue you mentioned is bug #812537 but this one is a different issue so should be a different bug. Sorry for the noise.

(by nejucomo)
I've created a small patch ("Nevow-fix-import.patch.0") to setup.py which opens the nevow/_version.py file and parses out the version using a regular expression.

Note: This is currently blocking the ability to pip install allmydata-tahoe 1.10.0 - see https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2032

(by zooko)
Dear maintainers of Nevow: please apply this patch, or else write a comment here saying why not. Thank you!

(by exarkun)
Hello all.

I guess I have to respond to zooko's call to "maintainers of Nevow". I am still at least a Nevow user and I won't rule out the possibility of doing at least some Nevow development in the future (to scratch my own itches). That said, it also wouldn't bother me at all if everyone using Nevow switched to twisted.web.template (though I know it's not possible for everyone since the latter provides only a subset of the functionality of the former). I'm also part of the ~divmod-dev team (and thus have permission to push changes to trunk).

I have avoided commenting on this bug up to this point because I don't have any problems with the setup.py currently included with Nevow. It installs properly in the environments where I need it to install (primarily user installs on Debian). I am a long way from understanding all of the complexity involved in the scenario described in this bug's summary. I don't know much about how virtualenv alters the Python runtime environment. I don't know much about how pip handles packages it is trying to install.

So as things stand, I am not likely to merge this change into Nevow trunk. It changes code that apparently has to interact with at least two systems I don't understand well. That code is untested and the change doesn't come with any tests. All taken together, that means it's not something I'm comfortable with. Since I also have no particular additional motivation (additional to "I like zooko and nejucomo and want their projects to succeed") to address these points, I will continue to remain hands-off on this issue.

Sorry I can't do more here. I hope one of the other committers is sufficiently interested to shepherd this change into trunk.

(by zooko)
Tristan Seligman said in comment #4 (https://bugs.launchpad.net/nevow/+bug/1091055/comments/4) that this was not a duplicate of https://bugs.launchpad.net/bugs/812537, but it seems to me that fixing 812537 would probably fix this. In any case, how about if we all (except for exarkun) go fix 812537 now, and then come back and see if this one is fixed?

Since Nevow now uses python-versioneer and since Nevow's setup.py no longer imports any part of Nevow and since travis-ci is using pip install to set up an environment in which to run Nevow's tests (and this is working), I believe this issue is now resolved.