Mercurial > public > mercurial-scm > hg
comparison setup.py @ 33591:ee11d18fcd3c stable
setup: fix mistake that prevented Python 3 from being excluded
My intent was to only allow Python 3 if the right environment variable
is set (for when people want to use `pip install .` on hg
locally). This fixes the bug in my previous change. I verified that
`python3.6 run-tests.py` still passes the tests that passed before,
and that all tests pass on 2.7 (including our virtualenv-using
installation test).
Differential Revision: https://phab.mercurial-scm.org/D185
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 26 Jul 2017 13:21:34 -0400 |
parents | a0bfcd08f5fe |
children | f30714a55523 |
comparison
equal
deleted
inserted
replaced
33590:52f82e7d6a7e | 33591:ee11d18fcd3c |
---|---|
2 # This is the mercurial setup script. | 2 # This is the mercurial setup script. |
3 # | 3 # |
4 # 'python setup.py install', or | 4 # 'python setup.py install', or |
5 # 'python setup.py --help' for more options | 5 # 'python setup.py --help' for more options |
6 | 6 |
7 import os | |
8 | |
7 supportedpy = '~= 2.7' | 9 supportedpy = '~= 2.7' |
8 if 'HGALLOWPYTHON3': | 10 if os.environ.get('HGALLOWPYTHON3', ''): |
9 # Mercurial will never work on Python 3 before 3.5 due to a lack | 11 # Mercurial will never work on Python 3 before 3.5 due to a lack |
10 # of % formatting on bytestrings, and can't work on 3.6.0 or 3.6.1 | 12 # of % formatting on bytestrings, and can't work on 3.6.0 or 3.6.1 |
11 # due to a bug in % formatting in bytestrings. | 13 # due to a bug in % formatting in bytestrings. |
12 # | 14 # |
13 # TODO: when we actually work on Python 3, use this string as the | 15 # TODO: when we actually work on Python 3, use this string as the |
99 "Couldn't import standard bz2 (incomplete Python install).") | 101 "Couldn't import standard bz2 (incomplete Python install).") |
100 | 102 |
101 ispypy = "PyPy" in sys.version | 103 ispypy = "PyPy" in sys.version |
102 | 104 |
103 import ctypes | 105 import ctypes |
104 import os, stat, subprocess, time | 106 import stat, subprocess, time |
105 import re | 107 import re |
106 import shutil | 108 import shutil |
107 import tempfile | 109 import tempfile |
108 from distutils import log | 110 from distutils import log |
109 # We have issues with setuptools on some platforms and builders. Until | 111 # We have issues with setuptools on some platforms and builders. Until |