Skip to content

Commit 84c3011

Browse files
committed
Deprecate Python 3.6 support.
No claim is made about when it will actually be dropped, but some notice seems polite. Signed-off-by: Mats Wichmann <[email protected]>
1 parent 5dd1d9c commit 84c3011

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
4040
build pdf versions which are then ignored.
4141
- Add the ability to print a Variables object for debugging purposes
4242
(provides a __str__ method in the class).
43+
- Mark Python 3.6 support as deprecated.
4344

4445

4546
RELEASE 4.7.0 - Sun, 17 Mar 2024 17:22:20 -0700

RELEASE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ NEW FUNCTIONALITY
2121
DEPRECATED FUNCTIONALITY
2222
------------------------
2323

24-
- List anything that's been deprecated since the last release
24+
- Mark Python 3.6 support as deprecated. Use --warn=no-python-version
25+
to quiet the warning.
2526

2627
CHANGED/ENHANCED EXISTING FUNCTIONALITY
2728
---------------------------------------

SCons/Script/Main.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
# these define the range of versions SCons supports
6767
minimum_python_version = (3, 6, 0)
68-
deprecated_python_version = (3, 6, 0)
68+
deprecated_python_version = (3, 7, 0) # the first non-deprecated version
6969

7070
# ordered list of SConsctruct names to look for if there is no -f flag
7171
KNOWN_SCONSTRUCT_NAMES = [
@@ -1104,11 +1104,13 @@ def _main(parser):
11041104
# warning about deprecated Python versions--delayed until here
11051105
# in case they disabled the warning in the SConscript files.
11061106
if python_version_deprecated():
1107-
msg = "Support for pre-%s Python version (%s) is deprecated.\n" + \
1108-
" If this will cause hardship, contact [email protected]"
11091107
deprecated_version_string = ".".join(map(str, deprecated_python_version))
1110-
SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,
1111-
msg % (deprecated_version_string, python_version_string()))
1108+
msg = (
1109+
f"Support for Python older than {deprecated_version_string}"
1110+
f" is deprecated ({python_version_string()} detected).\n"
1111+
" If this will cause hardship, contact [email protected]"
1112+
)
1113+
SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning, msg)
11121114

11131115
if not options.help:
11141116
# [ ] Clarify why we need to create Builder here at all, and

doc/man/scons.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,16 @@ unless the experimental Ninja tool is used.
112112
</para>
113113
<para>
114114
<emphasis>Changed in version 4.3.0:</emphasis>
115-
support for &Python; 3.5 is removed;
116-
the CPython project has retired 3.5:
117-
<ulink url="https://www.python.org/dev/peps/pep-0478"/>.
115+
support for &Python; 3.5 is removed.
116+
The CPython project retired 3.5 in Sept 2020:
117+
<ulink url="https://peps.python.org/pep-0478"/>.
118+
</para>
119+
<para>
120+
<emphasis>Changed in version 4.8.0:</emphasis>
121+
support for &Python; 3.6 is deprecated and will be removed
122+
in a future &SCons; release.
123+
The CPython project retired 3.6 in Sept 2021:
124+
<ulink url="https://peps.python.org/pep-0494"/>.
118125
</para>
119126

120127
<para>You set up an &SCons;

testing/framework/TestSCons.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959

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

6565
SConsVersion = default_version
6666

@@ -173,7 +173,7 @@ def deprecated_python_version(version=sys.version_info):
173173

174174
if deprecated_python_version():
175175
msg = r"""
176-
scons: warning: Support for pre-%s Python version (%s) is deprecated.
176+
scons: warning: Support for Python older than %s is deprecated (%s detected).
177177
If this will cause hardship, contact [email protected]
178178
"""
179179
deprecated_python_expr = (

0 commit comments

Comments
 (0)