Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce Python 2.7 during installation #414

Merged
merged 1 commit into from
Apr 25, 2017

Conversation

tpltnt
Copy link
Contributor

@tpltnt tpltnt commented Apr 20, 2017

Hi there,

this patch raises a RuntimeError if Python 2.7 is not used for the installation. Multiple people recently tried to install tahoe-lafs on Python 3 (despite the hint in the readme) so I made it hard to do the wrong thing.

Cheers,
tpltnt

setup.py Outdated
# make sure we have a proper version of python
if sys.version_info[:2] != (2, 7):
raise RuntimeError("Python version 2.7 is required.")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I don't think we actually depend on "2.7" (but definitely "less than 3.0" so maybe that would be a better check?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reduced the check to only test for python 2.

@codecov-io
Copy link

codecov-io commented Apr 20, 2017

Codecov Report

Merging #414 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #414      +/-   ##
==========================================
- Coverage   88.01%   88.01%   -0.01%     
==========================================
  Files         146      146              
  Lines       27578    27578              
  Branches     3921     3921              
==========================================
- Hits        24274    24273       -1     
- Misses       2599     2600       +1     
  Partials      705      705
Impacted Files Coverage Δ
src/allmydata/web/status.py 83.05% <0%> (-0.12%) ⬇️
src/allmydata/mutable/servermap.py 93.71% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7376e56...c0888de. Read the comment docs.

@meejah
Copy link
Contributor

meejah commented Apr 25, 2017

Okay, I've confirmed that this gives a way nicer error-message if you're on Debian stable and just created a virtualenv with virtualenv --python=python3 foo.

Namely, it says "Python version 2 required" instead of some parse-error from the setup.py of zfec (because it happens to print something but using the python2 syntax).

@meejah meejah merged commit a5095bb into tahoe-lafs:master Apr 25, 2017
@tpltnt tpltnt deleted the enforce-py2-setup branch April 27, 2017 10:44
@warner
Copy link
Member

warner commented Jun 5, 2017

BTW, I opened https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2876, as this change breaks our Ubuntu/Xenial (16.04-LTS) buildbot, where tox is a python3 binary, and appears to unconditionally use it's native sys.executable (so py3) for the setup.py sdist command.

Our Travis config runs everything in a py2 virtualenv, and updates tox, so it didn't expose this problem. Our buildbot doesn't do pull requests, so we don't have a great way to discover problems like this until after the land. I guess we should make it a point to watch the buildbot after landing cross-platform-sensitive changes and then get comfortable with reverting a patch if it causes problems that aren't caught by travis or appveyor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants