"tox" on debian (py3) can't run our setup.py #2747
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2747
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rkirshnan reported that running "tox" on current debian/testing fails.
On that platform (as well as some Ubuntu ones I've seen), the system-packaged
/usr/bin/tox
is shbang'ed to use python3. Tox runs the project'ssetup.py
to make an sdist tarball (which it then installs into the virtualenv). Tahoe'ssetup.py
has a line that explicitly fails when run with python3, to avoid confusion, since Tahoe only works with python-2.7 . When tox hits this, it fails.To fix this, I think we should take out the hard-fail. It might be good to leave in a warning (e.g. check
sys.version_info
), but move the version-based hard-fail to early in the entry-point script.We should do an experiment and try to install tahoe in a py3 virtualenv, and see what happens: I suspect that some of the dependencies (zfec? pycryptopp? foolscap?) will fail to install, so nobody would ever get to the point of even running
tahoe
. If they made it that far, the next question would be whether importing our dependencies would succeed: that might produce different errors depending upon which subcommand was run (since we sometimes avoid importing things before we really need them).I started working on this, but it's not trivial. We basically need to make our
setup.py
work correctly under both py2 and py3. The problems:execfile(../_auto_deps.py)
git
to compute a version string has bytes-vs-str issuesIf I bypass those two issues, tox is able to install an sdist, and then run the tests.
The second issue will be fixed when we move to Versioneer (#2748).
The first needs us to either find a py2/py3-compatible equivalent of
execfile()
, or (my preference) remove_auto_deps.py
and move theinstall_requires=
list intosetup.py
. That will also entail removing a lot of the code from*init*.py
that checks what versions of things are installed and complains if they don't look right (and frequently complains even if they do). #2749 covers this (#2283 is related, but doesn't go far enough).I'm torn whether to try to address this in the upcoming release (for the sake of developers using system "tox" on recent debian/ubuntu), or to punt until the next release (to avoid the deep
*init*.py
changes it would require).Milestone renamed
I surveyed a couple of releases. All current versions of debian ("sid", "testing", and even the latest release "jesse") use a python3-based tox. On ubuntu, trusty (14.04LTS) uses py2, but vivid (15.04) and beyond use py3. The next Ubuntu LTS (16.04 Xenial) is coming out in a month, and will use py3-based tox too.
We could fix this after 1.11.0 ships, under the theory that most people inclined to run unit tests will also be inclined to run from a git checkout.
But if we don't fix this before 1.11.0, most debian/ubuntu users will be unable to run the release's unit tests with our recommended process. They'll have to create a py2-based virtualenv,
pip install tox
into that, then run the resulting executable. Or, since they're going to make a virtualenv anyways (to run tahoe), they can just do "trial allmydata" from within the virtualenv.That doesn't sound like a great experience. It doesn't affect people's ability to use tahoe, just their ability to run the tests in a standard way.
Oh, I think we can do this. I figured out a 2+3 cross-compatible
execfile()
replacement to avoid changing the way we use_auto_deps.py
for now. And I think I can 2+3-ify the version string code too (I've got a py3-compatible flavor now, but doing 2+3 shouldn't be too hard).In dd84abd/trunk:
Very nice! Thanks. I can confirm that tox indeed works fine on Debian testing now on the latest master branch.