setup.py: work with tox under py3

This allows a python3-based "tox" (as shipped with modern debian and
ubuntu systems) to run setup.py egg_info, update_version, and sdist
commands. It moves the main "tahoe requires py2" check out of setup.py
and into allmydata.scripts.runner.run, where it gets applied at runtime
rather than build time.

It also changes the execfile(_auto_deps.py) and Versioneer-like "ask git
what our version string should be" code to work under both py2 and py3.

fixes ticket:2747
This commit is contained in:
Brian Warner
2016-03-22 22:22:53 -07:00
parent 17886c51aa
commit dd84abd9f2
2 changed files with 33 additions and 19 deletions

View File

@ -93,6 +93,8 @@ def runner(argv,
stdin=None, stdout=None, stderr=None,
install_node_control=True, additional_commands=None):
assert sys.version_info < (3,), ur"Tahoe-LAFS does not run under Python 3. Please use Python 2.7.x."
stdin = stdin or sys.stdin
stdout = stdout or sys.stdout
stderr = stderr or sys.stderr