Skip to content

Commit 37530ad

Browse files
committed
Remove Python 3.6 support
1 parent d1d5355 commit 37530ad

13 files changed

+23
-56
lines changed

CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
7777
a constant expression evaluation.
7878

7979
From Thaddeus Crews:
80+
- Removed Python 3.6 support.
8081
- Ruff/Mypy: Excluded items now synced.
8182

8283
From Alex James:

RELEASE.txt

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
2929
- List modifications to existing features, where the previous behavior
3030
wouldn't actually be considered a bug
3131

32+
- Removed Python 3.6 support.
33+
3234
- Override environments, created when giving construction environment
3335
keyword arguments to Builder calls (or manually, through the
3436
undocumented Override method), were modified not to "leak" on item deletion.

ReleaseConfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ version_tuple = (4, 8, 2, 'a', 0)
3737
# when that version is used. Python versions prior to deprecate_python_version
3838
# cause a warning to be issued (assuming it's not disabled). These values are
3939
# mandatory and must be present in the configuration file.
40-
unsupported_python_version = (3, 6, 0)
40+
unsupported_python_version = (3, 7, 0)
4141
deprecated_python_version = (3, 7, 0)
4242

4343
# If release_date is (yyyy, mm, dd, hh, mm, ss), that is used as the release

SCons/Action.py

-9
Original file line numberDiff line numberDiff line change
@@ -891,15 +891,6 @@ def scons_subproc_run(scons_env, *args, **kwargs) -> subprocess.CompletedProcess
891891
del kwargs['error']
892892
kwargs['check'] = check
893893

894-
# TODO: Python version-compat stuff: remap/remove too-new args if needed
895-
if 'text' in kwargs and sys.version_info < (3, 7):
896-
kwargs['universal_newlines'] = kwargs.pop('text')
897-
898-
if 'capture_output' in kwargs and sys.version_info < (3, 7):
899-
capture_output = kwargs.pop('capture_output')
900-
if capture_output:
901-
kwargs['stdout'] = kwargs['stderr'] = PIPE
902-
903894
# Most SCons tools/tests expect not to fail on things like missing files.
904895
# check=True (or error="raise") means we're okay to take an exception;
905896
# else we catch the likely exception and construct a dummy

SCons/ActionTests.py

+4-28
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,6 @@ def LocalFunc() -> None:
15411541

15421542
# Since the python bytecode has per version differences, we need different expected results per version
15431543
func_matches = {
1544-
(3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
1545-
(3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
15461544
(3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
15471545
(3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
15481546
(3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
@@ -1723,8 +1721,6 @@ def LocalFunc() -> None:
17231721
pass
17241722

17251723
func_matches = {
1726-
(3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
1727-
(3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
17281724
(3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
17291725
(3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
17301726
(3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
@@ -1736,8 +1732,6 @@ def LocalFunc() -> None:
17361732
}
17371733

17381734
meth_matches = {
1739-
(3, 5): bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'),
1740-
(3, 6): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
17411735
(3, 7): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
17421736
(3, 8): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
17431737
(3, 9): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
@@ -1978,8 +1972,6 @@ def LocalFunc() -> None:
19781972
pass
19791973

19801974
func_matches = {
1981-
(3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
1982-
(3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
19831975
(3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
19841976
(3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
19851977
(3, 9): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
@@ -2042,8 +2034,6 @@ def LocalFunc() -> None:
20422034
pass
20432035

20442036
matches = {
2045-
(3, 5): b'd\x00\x00S',
2046-
(3, 6): b'd\x00S\x00',
20472037
(3, 7): b'd\x00S\x00',
20482038
(3, 8): b'd\x00S\x00',
20492039
(3, 9): b'd\x00S\x00',
@@ -2246,8 +2236,6 @@ def func1(a, b, c):
22462236
# we need different expected results per version
22472237
# Note unlike the others, this result is a tuple, use assertIn
22482238
expected = {
2249-
(3, 5): (bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),),
2250-
(3, 6): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),),
22512239
(3, 7): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),),
22522240
(3, 8): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),),
22532241
(3, 9): (bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),),
@@ -2275,12 +2263,6 @@ def test_object_contents(self) -> None:
22752263
# Since the python bytecode has per version differences,
22762264
# we need different expected results per version
22772265
expected = {
2278-
(3, 5): bytearray(
2279-
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}}}"
2280-
),
2281-
(3, 6): bytearray(
2282-
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}}}"
2283-
),
22842266
(3, 7): bytearray(
22852267
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}}}"
22862268
),
@@ -2314,12 +2296,6 @@ def test_code_contents(self) -> None:
23142296

23152297
# Since the python bytecode has per version differences, we need different expected results per version
23162298
expected = {
2317-
(3, 5): bytearray(
2318-
b'0, 0, 0, 0,(Hello, World!),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'
2319-
),
2320-
(3, 6): bytearray(
2321-
b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'
2322-
),
23232299
(3, 7): bytearray(
23242300
b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'
23252301
),
@@ -2387,17 +2363,17 @@ def test_scons_subproc_run(self):
23872363
{"text": True, "check": False},
23882364
)
23892365

2390-
# 3.6:
2391-
sys.version_info = (3, 6, 2)
2366+
# 3.7:
2367+
sys.version_info = (3, 7, 2)
23922368
with self.subTest():
23932369
self.assertEqual(
23942370
scons_subproc_run(env, capture_output=True),
2395-
{"check": False, "stdout": PIPE, "stderr": PIPE},
2371+
{"capture_output": True, "check": False},
23962372
)
23972373
with self.subTest():
23982374
self.assertEqual(
23992375
scons_subproc_run(env, text=True),
2400-
{"check": False, "universal_newlines": True},
2376+
{"check": False, "text": True},
24012377
)
24022378
with self.subTest():
24032379
self.assertEqual(

SCons/Script/Main.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
from SCons import __version__ as SConsVersion
6767

6868
# these define the range of versions SCons supports
69-
minimum_python_version = (3, 6, 0)
69+
minimum_python_version = (3, 7, 0)
7070
deprecated_python_version = (3, 7, 0)
7171

7272
# ordered list of SConstruct names to look for if there is no -f flag
@@ -1356,12 +1356,6 @@ def order(dependencies):
13561356
# various print_* settings, tree_printer list, etc.
13571357
BuildTask.options = options
13581358

1359-
is_pypy = platform.python_implementation() == 'PyPy'
1360-
# As of 3.7, python removed support for threadless platforms.
1361-
# See https://www.python.org/dev/peps/pep-0011/
1362-
is_37_or_later = sys.version_info >= (3, 7)
1363-
# python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later
1364-
13651359
# As of python 3.4 threading has a dummy_threading module for use when there is no threading
13661360
# it's get_ident() will allways return -1, while real threading modules get_ident() will
13671361
# always return a positive integer

doc/man/scons.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ and a database of information about previous builds so
8787
details do not have to be recalculated each run.
8888
</para>
8989

90-
<para>&scons; requires &Python; 3.6 or later to run;
90+
<para>&scons; requires &Python; 3.7 or later to run;
9191
there should be no other dependencies or requirements,
9292
unless the experimental Ninja tool is used (requires the ninja package).
9393
</para>
@@ -104,6 +104,10 @@ in a future &SCons; release.
104104
The CPython project retired 3.6 in Sept 2021:
105105
<ulink url="https://peps.python.org/pep-0494"/>.
106106
</para>
107+
<para>
108+
<emphasis>Changed in version NEXT_RELEASE:</emphasis>
109+
support for &Python; 3.6 is removed.
110+
</para>
107111

108112
<para>
109113
You set up an &SCons; build by writing a script

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires = ["setuptools"]
55
[project]
66
name = "SCons"
77
description = "Open Source next-generation build tool."
8-
requires-python = ">=3.6"
8+
requires-python = ">=3.7"
99
license = { text = "MIT" }
1010
readme = { file = "README-package.rst", content-type = "text/x-rst" }
1111
authors = [{ name = "William Deegan", email = "[email protected]" }]
@@ -16,7 +16,6 @@ classifiers = [
1616
"Programming Language :: Python",
1717
"Programming Language :: Python :: 3",
1818
"Programming Language :: Python :: 3 :: Only",
19-
"Programming Language :: Python :: 3.6",
2019
"Programming Language :: Python :: 3.7",
2120
"Programming Language :: Python :: 3.8",
2221
"Programming Language :: Python :: 3.9",

runtest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def run_test(t, io_lock=None, run_async=True):
784784
command_args = []
785785
if debug:
786786
command_args.extend(['-m', debug])
787-
if args.devmode and sys.version_info >= (3, 7, 0):
787+
if args.devmode:
788788
command_args.append('-X dev')
789789
command_args.append(t.path)
790790
if args.runner and t.path in unittests:

scripts/scons-configure-cache.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
import sys
5050

5151
# python compatibility check
52-
if sys.version_info < (3, 6, 0):
52+
if sys.version_info < (3, 7, 0):
5353
msg = "scons: *** SCons version %s does not run under Python version %s.\n\
54-
Python >= 3.6.0 is required.\n"
54+
Python >= 3.7.0 is required.\n"
5555
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
5656
sys.exit(1)
5757

scripts/scons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
import sys
4343

4444
# Python compatibility check
45-
if sys.version_info < (3, 6, 0):
45+
if sys.version_info < (3, 7, 0):
4646
msg = "scons: *** SCons version %s does not run under Python version %s.\n\
47-
Python >= 3.6.0 is required.\n"
47+
Python >= 3.7.0 is required.\n"
4848
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
4949
sys.exit(1)
5050

scripts/sconsign.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
import sys
4242

4343
# python compatibility check
44-
if sys.version_info < (3, 6, 0):
44+
if sys.version_info < (3, 7, 0):
4545
msg = "scons: *** SCons version %s does not run under Python version %s.\n\
46-
Python >= 3.6.0 is required.\n"
46+
Python >= 3.7.0 is required.\n"
4747
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
4848
sys.exit(1)
4949

testing/framework/TestSCons.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
default_version = '4.8.2ayyyymmdd'
6060

6161
# TODO: these need to be hand-edited when there are changes
62-
python_version_unsupported = (3, 6, 0)
62+
python_version_unsupported = (3, 7, 0)
6363
python_version_deprecated = (3, 7, 0)
6464
python_version_supported_str = "3.7.0" # str of lowest non-deprecated Python
6565

0 commit comments

Comments
 (0)