diff options
author | William Deegan <bill@baddogconsulting.com> | 2024-11-16 23:50:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-16 23:50:41 (GMT) |
commit | 9f387ef05560015dd3d9efbd65285e1bac74c132 (patch) | |
tree | ccc931472350632c67108a23520a320db0193191 | |
parent | 7617dcc1f4fff41fd86faf01a41554038f84e366 (diff) | |
parent | 37530ad7d18bbe192da134808194cdca1941dd74 (diff) | |
download | SCons-9f387ef05560015dd3d9efbd65285e1bac74c132.zip SCons-9f387ef05560015dd3d9efbd65285e1bac74c132.tar.gz SCons-9f387ef05560015dd3d9efbd65285e1bac74c132.tar.bz2 |
Merge pull request #4642 from Repiteo/remove-python-3.6
Remove Python 3.6 support
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | RELEASE.txt | 2 | ||||
-rwxr-xr-x | ReleaseConfig | 2 | ||||
-rw-r--r-- | SCons/Action.py | 9 | ||||
-rw-r--r-- | SCons/ActionTests.py | 32 | ||||
-rw-r--r-- | SCons/Script/Main.py | 8 | ||||
-rw-r--r-- | doc/man/scons.xml | 6 | ||||
-rw-r--r-- | pyproject.toml | 3 | ||||
-rwxr-xr-x | runtest.py | 2 | ||||
-rw-r--r-- | scripts/scons-configure-cache.py | 4 | ||||
-rwxr-xr-x | scripts/scons.py | 4 | ||||
-rw-r--r-- | scripts/sconsign.py | 4 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 2 |
13 files changed, 23 insertions, 56 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ad1c929..227a56f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -77,6 +77,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER a constant expression evaluation. From Thaddeus Crews: + - Removed Python 3.6 support. - Ruff/Mypy: Excluded items now synced. - Ruff: Linter includes new rules - `FA`, `UP006`, `UP007`, and `UP037` - to detect and upgrade legacy type-hint syntax. diff --git a/RELEASE.txt b/RELEASE.txt index 1863443..72ec73c 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -29,6 +29,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY - List modifications to existing features, where the previous behavior wouldn't actually be considered a bug +- Removed Python 3.6 support. + - Override environments, created when giving construction environment keyword arguments to Builder calls (or manually, through the undocumented Override method), were modified not to "leak" on item deletion. diff --git a/ReleaseConfig b/ReleaseConfig index f124879..3ec9df0 100755 --- a/ReleaseConfig +++ b/ReleaseConfig @@ -37,7 +37,7 @@ version_tuple = (4, 8, 2, 'a', 0) # when that version is used. Python versions prior to deprecate_python_version # cause a warning to be issued (assuming it's not disabled). These values are # mandatory and must be present in the configuration file. -unsupported_python_version = (3, 6, 0) +unsupported_python_version = (3, 7, 0) deprecated_python_version = (3, 7, 0) # If release_date is (yyyy, mm, dd, hh, mm, ss), that is used as the release diff --git a/SCons/Action.py b/SCons/Action.py index 6022b19..18a488a 100644 --- a/SCons/Action.py +++ b/SCons/Action.py @@ -893,15 +893,6 @@ def scons_subproc_run(scons_env, *args, **kwargs) -> subprocess.CompletedProcess del kwargs['error'] kwargs['check'] = check - # TODO: Python version-compat stuff: remap/remove too-new args if needed - if 'text' in kwargs and sys.version_info < (3, 7): - kwargs['universal_newlines'] = kwargs.pop('text') - - if 'capture_output' in kwargs and sys.version_info < (3, 7): - capture_output = kwargs.pop('capture_output') - if capture_output: - kwargs['stdout'] = kwargs['stderr'] = PIPE - # Most SCons tools/tests expect not to fail on things like missing files. # check=True (or error="raise") means we're okay to take an exception; # else we catch the likely exception and construct a dummy diff --git a/SCons/ActionTests.py b/SCons/ActionTests.py index 497de18..ed87e03 100644 --- a/SCons/ActionTests.py +++ b/SCons/ActionTests.py @@ -1545,8 +1545,6 @@ class CommandGeneratorActionTestCase(unittest.TestCase): # Since the python bytecode has per version differences, we need different expected results per version func_matches = { - (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), - (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), @@ -1727,8 +1725,6 @@ class FunctionActionTestCase(unittest.TestCase): pass func_matches = { - (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), - (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), @@ -1740,8 +1736,6 @@ class FunctionActionTestCase(unittest.TestCase): } meth_matches = { - (3, 5): bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'), - (3, 6): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 8): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 9): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), @@ -1982,8 +1976,6 @@ class LazyActionTestCase(unittest.TestCase): pass func_matches = { - (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), - (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), @@ -2046,8 +2038,6 @@ class ActionCallerTestCase(unittest.TestCase): pass matches = { - (3, 5): b'd\x00\x00S', - (3, 6): b'd\x00S\x00', (3, 7): b'd\x00S\x00', (3, 8): b'd\x00S\x00', (3, 9): b'd\x00S\x00', @@ -2250,8 +2240,6 @@ class ObjectContentsTestCase(unittest.TestCase): # we need different expected results per version # Note unlike the others, this result is a tuple, use assertIn expected = { - (3, 5): (bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),), - (3, 6): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),), (3, 7): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),), (3, 8): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),), (3, 9): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),), @@ -2279,12 +2267,6 @@ class ObjectContentsTestCase(unittest.TestCase): # Since the python bytecode has per version differences, # we need different expected results per version expected = { - (3, 5): bytearray( - b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}" - ), - (3, 6): bytearray( - b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}" - ), (3, 7): bytearray( b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}" ), @@ -2318,12 +2300,6 @@ class ObjectContentsTestCase(unittest.TestCase): # Since the python bytecode has per version differences, we need different expected results per version expected = { - (3, 5): bytearray( - b'0, 0, 0, 0,(Hello, World!),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)' - ), - (3, 6): bytearray( - b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)' - ), (3, 7): bytearray( b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)' ), @@ -2391,17 +2367,17 @@ class ObjectContentsTestCase(unittest.TestCase): {"text": True, "check": False}, ) - # 3.6: - sys.version_info = (3, 6, 2) + # 3.7: + sys.version_info = (3, 7, 2) with self.subTest(): self.assertEqual( scons_subproc_run(env, capture_output=True), - {"check": False, "stdout": PIPE, "stderr": PIPE}, + {"capture_output": True, "check": False}, ) with self.subTest(): self.assertEqual( scons_subproc_run(env, text=True), - {"check": False, "universal_newlines": True}, + {"check": False, "text": True}, ) with self.subTest(): self.assertEqual( diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index 7f04d00..79cf832 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -67,7 +67,7 @@ from SCons.Util.stats import count_stats, memory_stats, time_stats, ENABLE_JSON, from SCons import __version__ as SConsVersion # these define the range of versions SCons supports -minimum_python_version = (3, 6, 0) +minimum_python_version = (3, 7, 0) deprecated_python_version = (3, 7, 0) # ordered list of SConstruct names to look for if there is no -f flag @@ -1357,12 +1357,6 @@ def _build_targets(fs, options, targets, target_top): # various print_* settings, tree_printer list, etc. BuildTask.options = options - is_pypy = platform.python_implementation() == 'PyPy' - # As of 3.7, python removed support for threadless platforms. - # See https://www.python.org/dev/peps/pep-0011/ - is_37_or_later = sys.version_info >= (3, 7) - # python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later - # As of python 3.4 threading has a dummy_threading module for use when there is no threading # it's get_ident() will allways return -1, while real threading modules get_ident() will # always return a positive integer diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 0193924..8366bbd 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -87,7 +87,7 @@ and a database of information about previous builds so details do not have to be recalculated each run. </para> -<para>&scons; requires &Python; 3.6 or later to run; +<para>&scons; requires &Python; 3.7 or later to run; there should be no other dependencies or requirements, unless the experimental Ninja tool is used (requires the ninja package). </para> @@ -104,6 +104,10 @@ in a future &SCons; release. The CPython project retired 3.6 in Sept 2021: <ulink url="https://peps.python.org/pep-0494"/>. </para> +<para> +<emphasis>Changed in version NEXT_RELEASE:</emphasis> +support for &Python; 3.6 is removed. +</para> <para> You set up an &SCons; build by writing a script diff --git a/pyproject.toml b/pyproject.toml index 5f3a49e..7d47aa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = ["setuptools"] [project] name = "SCons" description = "Open Source next-generation build tool." -requires-python = ">=3.6" +requires-python = ">=3.7" license = { text = "MIT" } readme = { file = "README-package.rst", content-type = "text/x-rst" } authors = [{ name = "William Deegan", email = "bill@baddogconsulting.com" }] @@ -16,7 +16,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -786,7 +786,7 @@ def run_test(t, io_lock=None, run_async=True): command_args = [] if debug: command_args.extend(['-m', debug]) - if args.devmode and sys.version_info >= (3, 7, 0): + if args.devmode: command_args.append('-X dev') command_args.append(t.path) if args.runner and t.path in unittests: diff --git a/scripts/scons-configure-cache.py b/scripts/scons-configure-cache.py index 2ae6b14..c30859d 100644 --- a/scripts/scons-configure-cache.py +++ b/scripts/scons-configure-cache.py @@ -49,9 +49,9 @@ import os import sys # python compatibility check -if sys.version_info < (3, 6, 0): +if sys.version_info < (3, 7, 0): msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python >= 3.6.0 is required.\n" +Python >= 3.7.0 is required.\n" sys.stderr.write(msg % (__version__, sys.version.split()[0])) sys.exit(1) diff --git a/scripts/scons.py b/scripts/scons.py index efafdef..9c5be9d 100755 --- a/scripts/scons.py +++ b/scripts/scons.py @@ -42,9 +42,9 @@ import os import sys # Python compatibility check -if sys.version_info < (3, 6, 0): +if sys.version_info < (3, 7, 0): msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python >= 3.6.0 is required.\n" +Python >= 3.7.0 is required.\n" sys.stderr.write(msg % (__version__, sys.version.split()[0])) sys.exit(1) diff --git a/scripts/sconsign.py b/scripts/sconsign.py index 95a9b96..a467eba 100644 --- a/scripts/sconsign.py +++ b/scripts/sconsign.py @@ -41,9 +41,9 @@ import os import sys # python compatibility check -if sys.version_info < (3, 6, 0): +if sys.version_info < (3, 7, 0): msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python >= 3.6.0 is required.\n" +Python >= 3.7.0 is required.\n" sys.stderr.write(msg % (__version__, sys.version.split()[0])) sys.exit(1) diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 806b596..51aa7cf 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -60,7 +60,7 @@ from TestCmd import PIPE default_version = '4.8.2ayyyymmdd' # TODO: these need to be hand-edited when there are changes -python_version_unsupported = (3, 6, 0) +python_version_unsupported = (3, 7, 0) python_version_deprecated = (3, 7, 0) python_version_supported_str = "3.7.0" # str of lowest non-deprecated Python |