python-compat: drop support for Python3.6 and 3.7
As discussed on the mailing list¹, these are old version that seems safe to
drop. Python 3.8 comes with various improvement especially regarding typing
capabilities.
[1] https://lists.mercurial-scm.org/pipermail/mercurial-devel/2024-July/297998.html
--- a/contrib/automation/hgautomation/cli.py Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/automation/hgautomation/cli.py Tue Sep 10 22:26:23 2024 +0200
@@ -446,9 +446,6 @@
help='Python version to use',
choices={
'system3',
- '3.5',
- '3.6',
- '3.7',
'3.8',
'pypy',
'pypy3.5',
@@ -475,7 +472,7 @@
sp.add_argument(
'--python-version',
help='Python version to use',
- choices={'3.5', '3.6', '3.7', '3.8', '3.9', '3.10'},
+ choices={'3.8', '3.9', '3.10'},
default='3.9',
)
sp.add_argument(
--- a/contrib/automation/hgautomation/linux.py Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/automation/hgautomation/linux.py Tue Sep 10 22:26:23 2024 +0200
@@ -25,7 +25,7 @@
}
INSTALL_PYTHONS = r'''
-PYENV3_VERSIONS="3.5.10 3.6.13 3.7.10 3.8.10 3.9.5 pypy3.5-7.0.0 pypy3.6-7.3.3 pypy3.7-7.3.3"
+PYENV3_VERSIONS="3.8.10 3.9.5 pypy3.5-7.0.0 pypy3.6-7.3.3 pypy3.7-7.3.3"
git clone https://github.com/pyenv/pyenv.git /hgdev/pyenv
pushd /hgdev/pyenv
--- a/contrib/automation/linux-requirements-py3.txt Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/automation/linux-requirements-py3.txt Tue Sep 10 22:26:23 2024 +0200
@@ -16,7 +16,7 @@
--hash=sha256:3901be1cb7c2a780f14668691474d9252c070a756be0a9ead98cfeabfa11aeb8 \
--hash=sha256:8ee1e5f5a1afc5b19bdfae4fdf0c35ed324074bdce3500c939842c8f818645d9
# via black
-black==19.10b0 ; python_version >= "3.6" and platform_python_implementation != "PyPy" \
+black==19.10b0 ; python_version >= "3.8" and platform_python_implementation != "PyPy" \
--hash=sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b \
--hash=sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539
# via -r contrib/automation/linux-requirements.txt.in
--- a/contrib/automation/linux-requirements.txt.in Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/automation/linux-requirements.txt.in Tue Sep 10 22:26:23 2024 +0200
@@ -1,5 +1,5 @@
# black pulls in typed-ast, which doesn't install on PyPy.
-black==19.10b0 ; python_version >= '3.6' and platform_python_implementation != 'PyPy'
+black==19.10b0 ; python_version >= '3.8' and platform_python_implementation != 'PyPy'
# Bazaar doesn't work with Python 3 nor PyPy.
bzr ; python_version <= '2.7' and platform_python_implementation == 'CPython'
docutils
@@ -13,5 +13,5 @@
# Needed to avoid warnings from fuzzywuzzy.
python-Levenshtein
# typed-ast dependency doesn't install on PyPy.
-typed-ast ; python_version >= '3.0' and platform_python_implementation != 'PyPy'
+typed-ast ; python_version >= '3.8' and platform_python_implementation != 'PyPy'
vcrpy
--- a/contrib/packaging/debian/rules Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/packaging/debian/rules Tue Sep 10 22:26:23 2024 +0200
@@ -15,7 +15,7 @@
# the actual versions that are installed, see the comment above where we set
# DEB_HG_PYTHON_VERSIONS below. If you choose to set `DEB_HG_PYTHON_VERSIONS`
# yourself, set it to a space-separated string of python version numbers, like:
-# DEB_HG_PYTHON_VERSIONS="3.7 3.8" make deb
+# DEB_HG_PYTHON_VERSIONS="3.8" make deb
DEB_HG_MULTI_VERSION?=0
# Set to 1 to make /usr/bin/hg a symlink to chg, and move hg to
--- a/contrib/packaging/inno/readme.rst Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/packaging/inno/readme.rst Tue Sep 10 22:26:23 2024 +0200
@@ -8,7 +8,7 @@
* Inno Setup (http://jrsoftware.org/isdl.php) version 5.4 or newer.
Be sure to install the optional Inno Setup Preprocessor feature,
which is required.
-* Python 3.6+ (to run the ``packaging.py`` script)
+* Python 3.8+ (to run the ``packaging.py`` script)
Building
========
--- a/contrib/packaging/wix/readme.rst Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/packaging/wix/readme.rst Tue Sep 10 22:26:23 2024 +0200
@@ -16,7 +16,7 @@
The following system dependencies must be installed:
-* Python 3.6+ (to run the ``packaging.py`` script)
+* Python 3.8+ (to run the ``packaging.py`` script)
Building
========
--- a/contrib/python3-ratchet.py Tue Sep 10 21:19:36 2024 +0200
+++ b/contrib/python3-ratchet.py Tue Sep 10 22:26:23 2024 +0200
@@ -93,23 +93,6 @@
'--working-tests must be from that repo'
)
sys.exit(1)
- try:
- subprocess.check_call(
- [
- opts.python3,
- '-c',
- 'import sys ; '
- 'assert ((3, 5) <= sys.version_info < (3, 6) '
- 'or sys.version_info >= (3, 6, 2))',
- ]
- )
- except subprocess.CalledProcessError:
- print(
- 'warning: Python 3.6.0 and 3.6.1 have '
- 'a bug which breaks Mercurial'
- )
- print('(see https://bugs.python.org/issue29714 for details)')
- sys.exit(1)
rt = subprocess.Popen(
[
--- a/setup.py Tue Sep 10 21:19:36 2024 +0200
+++ b/setup.py Tue Sep 10 22:26:23 2024 +0200
@@ -5,11 +5,9 @@
# 'python setup.py --help' for more options
import os
-# Mercurial can't work on 3.6.0 or 3.6.1 due to a bug in % formatting
-# in bytestrings.
supportedpy = ','.join(
[
- '>=3.6.2',
+ '>=3.8.0',
]
)