comparison setup.py @ 42175:cd1bede340b0 stable

setup: tweak error message for Python 3 We now have beta support for Python 3. In my opinion, it isn't yet stable enough to allow `pip install Mercurial` to work with Python 3 out of the box: we don't want people accidentally using Mercurial with Python 3 just yet. But I do think we should be more friendly about informing people of their options. This commit tweaks the error message that users see when running setup.py with Python 3. We instruct them about the current level of Python 3 support, point them at the wiki for more info, and give them instructions on how to bypass the check. As part of this, I also changed which version value is printed, as we were printing a named tuple before.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 21 Apr 2019 08:57:01 -0700
parents bd92dd3eff42
children 810f66b468cd
comparison
equal deleted inserted replaced
42174:bd92dd3eff42 42175:cd1bede340b0
83 if os.path.isdir('.hg') or 'HGPYTHON3' in os.environ: 83 if os.path.isdir('.hg') or 'HGPYTHON3' in os.environ:
84 badpython = False 84 badpython = False
85 85
86 if badpython: 86 if badpython:
87 error = """ 87 error = """
88 Mercurial only supports Python 2.7.
89 Python {py} detected. 88 Python {py} detected.
90 Please re-run with Python 2.7. 89
91 """.format(py=sys.version_info) 90 Mercurial currently has beta support for Python 3 and use of Python 2.7 is
91 recommended for the best experience.
92
93 Please re-run with Python 2.7 for a faster, less buggy experience.
94
95 If you would like to beta test Mercurial with Python 3, this error can
96 be suppressed by defining the HGPYTHON3 environment variable when invoking
97 this command. No special environment variables or configuration changes are
98 necessary to run `hg` with Python 3.
99
100 See https://www.mercurial-scm.org/wiki/Python3 for more on Mercurial's
101 Python 3 support.
102 """.format(py='.'.join('%d' % x for x in sys.version_info[0:2]))
92 103
93 printf(error, file=sys.stderr) 104 printf(error, file=sys.stderr)
94 sys.exit(1) 105 sys.exit(1)
95 106
96 # Solaris Python packaging brain damage 107 # Solaris Python packaging brain damage