nevow cannot be installed with pip into a clean virtualenv

Bug #1091055 reported by Michael Hudson-Doyle
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Tahoe-LAFS
Unknown
Unknown
nevow
New
Undecided
Unassigned

Bug Description

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...

Related branches

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

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?

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

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.

affects: divmod.org → nevow
Revision history for this message
Tristan Seligmann (mithrandi) wrote :

aaaaand... this is apparently a dup of bug #812537.

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

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.

summary: - nevow does not include install_requires in setup.py
+ nevow cannot be installed with pip into a clean virtualenv
description: updated
Revision history for this message
nejucomo (nejucomo) wrote :

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

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

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

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

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.

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

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?

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

According to https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2032#comment:18 , this issue is fixed in Nevow 0.11.1.

Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

This ticket has been moved to here: https://github.com/twisted/nevow/issues/13

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.