Skip to content

Commit dc70d15

Browse files
authored
Merge pull request #4848 from mwichmann/feature/py315
Add support for Python 3.15
2 parents c3ad1a7 + 1b71668 commit dc70d15

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
8181
on a one-time uuid to make a path to the file.
8282
- Clarify VariantDir behavior when switching to not duplicate sources
8383
and tweak wording a bit.
84+
<<<<<<< feature/py315
85+
- Test suite: add support for Python 3.15 in the Action unit tests.
86+
=======
8487
- Update documentation of the three file-finding functions in the API
8588
(FindFile, FindInstalledFiles, FindSourceFiles) as well as FindPathDirs.
8689
Also add a test for FindFile to be sure it locates non-existing
8790
derived files as advertised.
91+
>>>>>>> master
8892
- zip tool now uses zipfile module's "from_file" method to populate
8993
ZipInfo records, rather than doing manually.
9094
- Update documentation for linking-related construction variables.

RELEASE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ long function signature lines, and some linting-insipired cleanups.
8181

8282
- Test suite: end to end tests don't use assert in result checks
8383

84+
- Test suite: add support for Python 3.15 in the Action unit tests.
8485
- zip tool now uses zipfile module's "from_file" method to populate ZipInfo
8586
records, rather than doing manually.
8687

SCons/ActionTests.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def __call__(self) -> None:
4343
import sys
4444
import types
4545
import unittest
46-
from unittest import mock
4746
from subprocess import PIPE
4847
from typing import TYPE_CHECKING
48+
from unittest import mock
4949

5050
# If assertEqual truncates strings so it's hard to see the diff, enable this:
5151
# if 'unittest.util' in __import__('sys').modules:
@@ -1557,6 +1557,7 @@ def LocalFunc() -> None:
15571557
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
15581558
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
15591559
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
1560+
(3, 15): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00\x00\x00Q\x00!\x00),(),()'),
15601561
}
15611562

15621563
meth_matches = [
@@ -1738,6 +1739,7 @@ def LocalFunc() -> None:
17381739
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
17391740
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
17401741
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
1742+
(3, 15): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00\x00\x00Q\x00!\x00),(),()'),
17411743

17421744
}
17431745

@@ -1750,6 +1752,8 @@ def LocalFunc() -> None:
17501752
(3, 12): bytearray(b'1, 1, 0, 0,(),(),(\x97\x00y\x00),(),()'),
17511753
(3, 13): bytearray(b'1, 1, 0, 0,(),(),(\x95\x00g\x00),(),()'),
17521754
(3, 14): bytearray(b'1, 1, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
1755+
(3, 15): bytearray(b'1, 1, 0, 0,(),(),(\x80\x00\x00\x00Q\x00!\x00),(),()'),
1756+
17531757
}
17541758

17551759
def factory(act, **kw):
@@ -1991,6 +1995,7 @@ def LocalFunc() -> None:
19911995
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
19921996
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
19931997
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
1998+
(3, 15): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00\x00\x00Q\x00!\x00),(),()'),
19941999
}
19952000

19962001
meth_matches = [
@@ -2054,6 +2059,7 @@ def LocalFunc() -> None:
20542059
(3, 12): b'\x97\x00y\x00',
20552060
(3, 13): b'\x95\x00g\x00',
20562061
(3, 14): b'\x80\x00R\x00#\x00',
2062+
(3, 15): b'\x80\x00\x00\x00Q\x00!\x00',
20572063
}
20582064

20592065
with self.subTest():
@@ -2260,6 +2266,7 @@ def func1(a, b, c):
22602266
(3, 12): (bytearray(b"3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()"),),
22612267
(3, 13): (bytearray(b"3, 3, 0, 0,(),(),(\x95\x00U\x00$\x00),(),()"),),
22622268
(3, 14): (bytearray(b"3, 3, 0, 0,(),(),(\x80\x00V\x00#\x00),(),()"),),
2269+
(3, 15): bytearray(b'3, 3, 0, 0,(),(),(\x80\x00\x00\x00U\x00!\x00),(),()'),
22632270
}
22642271

22652272
c = SCons.Action._function_contents(func1)
@@ -2301,6 +2308,9 @@ def test_object_contents(self) -> None:
23012308
(3, 14): bytearray(
23022309
b"{TestClass:__main__}[[[(<class 'object'>, ()), [(<class '__main__.TestClass'>, (<class 'object'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00R\x00V\x00n\x00\x00\x00\x00\x00\x00\x00\x00\x00R\x01V\x00n\x01\x00\x00\x00\x00\x00\x00\x00\x00R\x02#\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()}}{{{a=a,b=b}}}"
23032310
),
2311+
(3, 15): bytearray(
2312+
b"{TestClass:__main__}[[[(<class 'object'>, ()), [(<class '__main__.TestClass'>, (<class 'object'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00\x00\x00Q\x00U\x00m\x00\x00\x00\x00\x00\x00\x00\x00\x00Q\x01U\x00m\x01\x00\x00\x00\x00\x00\x00\x00\x00Q\x02!\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00\x00\x00Q\x00!\x00),(),()}}{{{a=a,b=b}}}"
2313+
),
23042314
}
23052315
self.assertEqual(c, expected[sys.version_info[:2]])
23062316

@@ -2336,6 +2346,9 @@ def test_code_contents(self) -> None:
23362346
(3, 14): bytearray(
23372347
b"0, 0, 0, 0,(Hello, World!),(print),(\x80\x00]\x00!\x00R\x004\x01\x00\x00\x00\x00\x00\x00\x1f\x00R\x01#\x00)"
23382348
),
2349+
(3, 15): bytearray(
2350+
b"0, 0, 0, 0,(Hello, World!),(print),(\x80\x00\x00\x00\\\x00\x1f\x00Q\x002\x01\x00\x00\x00\x00\x00\x00\x1d\x00Q\x01!\x00)"
2351+
),
23392352
}
23402353

23412354
self.assertEqual(c, expected[sys.version_info[:2]])

0 commit comments

Comments
 (0)