Skip to content

Commit 7255c54

Browse files
authored
Merge pull request #4457 from mwichmann/py313-support
Initial Python 3.13 support
2 parents 3236d7a + 7557055 commit 7255c54

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

CHANGES.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
4242
- Fix issue #4320: add an optional argument list string to configure's CheckFunc
4343
method so that the generated function argument list matches the function's
4444
prototype when including a header file.
45-
45+
4646
From William Deegan:
4747
- Fix sphinx config to handle SCons versions with post such as: 4.6.0.post1
4848

@@ -53,6 +53,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
5353
- Fix of the --debug=sconscript option to return exist statements when using return
5454
statement with stop flag enabled
5555

56+
From Mats Wichmann:
57+
- Add support for Python 3.13 (as of alpha 2). So far only affects
58+
expected bytecodes in ActionTests.py.
59+
5660

5761
RELEASE 4.6.0 - Sun, 19 Nov 2023 17:22:20 -0700
5862

RELEASE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
3232
- Add an optional argument list string to configure's CheckFunc method so
3333
that the generated function argument list matches the function's
3434
prototype when including a header file. Fixes GH Issue #4320
35+
- Now supports pre-release Python 3.13
3536

3637
FIXES
3738
-----

SCons/ActionTests.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def test_ListAction(self) -> None:
347347
"""Test the Action() factory's creation of ListAction objects."""
348348

349349
a1 = SCons.Action.Action(["x", "y", "z", ["a", "b", "c"]])
350-
assert isinstance(a1, SCons.Action.ListAction), a1
350+
assert isinstance(a1, SCons.Action.ListAction), f"a1 is {type(a1)}"
351351
assert a1.varlist == (), a1.varlist
352352
assert isinstance(a1.list[0], SCons.Action.CommandAction), a1.list[0]
353353
assert a1.list[0].cmd_list == "x", a1.list[0].cmd_list
@@ -359,7 +359,7 @@ def test_ListAction(self) -> None:
359359
assert a1.list[3].cmd_list == ["a", "b", "c"], a1.list[3].cmd_list
360360

361361
a2 = SCons.Action.Action("x\ny\nz")
362-
assert isinstance(a2, SCons.Action.ListAction), a2
362+
assert isinstance(a2, SCons.Action.ListAction), f"a2 is {type(a2)}"
363363
assert a2.varlist == (), a2.varlist
364364
assert isinstance(a2.list[0], SCons.Action.CommandAction), a2.list[0]
365365
assert a2.list[0].cmd_list == "x", a2.list[0].cmd_list
@@ -372,7 +372,7 @@ def foo() -> None:
372372
pass
373373

374374
a3 = SCons.Action.Action(["x", foo, "z"])
375-
assert isinstance(a3, SCons.Action.ListAction), a3
375+
assert isinstance(a3, SCons.Action.ListAction), f"a3 is {type(a3)}"
376376
assert a3.varlist == (), a3.varlist
377377
assert isinstance(a3.list[0], SCons.Action.CommandAction), a3.list[0]
378378
assert a3.list[0].cmd_list == "x", a3.list[0].cmd_list
@@ -382,7 +382,7 @@ def foo() -> None:
382382
assert a3.list[2].cmd_list == "z", a3.list[2].cmd_list
383383

384384
a4 = SCons.Action.Action(["x", "y"], strfunction=foo)
385-
assert isinstance(a4, SCons.Action.ListAction), a4
385+
assert isinstance(a4, SCons.Action.ListAction), f"a4 is {type(a4)}"
386386
assert a4.varlist == (), a4.varlist
387387
assert isinstance(a4.list[0], SCons.Action.CommandAction), a4.list[0]
388388
assert a4.list[0].cmd_list == "x", a4.list[0].cmd_list
@@ -392,7 +392,7 @@ def foo() -> None:
392392
assert a4.list[1].strfunction == foo, a4.list[1].strfunction
393393

394394
a5 = SCons.Action.Action("x\ny", strfunction=foo)
395-
assert isinstance(a5, SCons.Action.ListAction), a5
395+
assert isinstance(a5, SCons.Action.ListAction), f"a5 is {type(a5)}"
396396
assert a5.varlist == (), a5.varlist
397397
assert isinstance(a5.list[0], SCons.Action.CommandAction), a5.list[0]
398398
assert a5.list[0].cmd_list == "x", a5.list[0].cmd_list
@@ -401,6 +401,9 @@ def foo() -> None:
401401
assert a5.list[1].cmd_list == "y", a5.list[1].cmd_list
402402
assert a5.list[1].strfunction == foo, a5.list[1].strfunction
403403

404+
a6 = SCons.Action.Action(["action with space"])
405+
assert isinstance(a6, SCons.Action.CommandAction), f"a6 is {type(a6)}"
406+
404407
def test_CommandGeneratorAction(self) -> None:
405408
"""Test the Action factory's creation of CommandGeneratorAction objects."""
406409

@@ -1544,6 +1547,7 @@ def LocalFunc() -> None:
15441547
(3, 10): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
15451548
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
15461549
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
1550+
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
15471551
}
15481552

15491553
meth_matches = [
@@ -1725,6 +1729,7 @@ def LocalFunc() -> None:
17251729
(3, 10): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
17261730
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
17271731
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
1732+
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
17281733

17291734
}
17301735

@@ -1737,6 +1742,7 @@ def LocalFunc() -> None:
17371742
(3, 10): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
17381743
(3, 11): bytearray(b'1, 1, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
17391744
(3, 12): bytearray(b'1, 1, 0, 0,(),(),(\x97\x00y\x00),(),()'),
1745+
(3, 13): bytearray(b'1, 1, 0, 0,(),(),(\x95\x00g\x00),(),()'),
17401746
}
17411747

17421748
def factory(act, **kw):
@@ -1978,6 +1984,7 @@ def LocalFunc() -> None:
19781984
(3, 10): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
19791985
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
19801986
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
1987+
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
19811988
}
19821989

19831990
meth_matches = [
@@ -2041,6 +2048,7 @@ def LocalFunc() -> None:
20412048
(3, 10): b'd\x00S\x00',
20422049
(3, 11): b'\x97\x00d\x00S\x00',
20432050
(3, 12): b'\x97\x00y\x00',
2051+
(3, 13): b'\x95\x00g\x00',
20442052
}
20452053

20462054
with self.subTest():
@@ -2247,6 +2255,7 @@ def func1(a, b, c):
22472255
),
22482256
(3, 11): (bytearray(b'3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()'),),
22492257
(3, 12): (bytearray(b'3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()'),),
2258+
(3, 13): (bytearray(b'3, 3, 0, 0,(),(),(\x95\x00U\x00$\x00),(),()'),),
22502259
}
22512260

22522261
c = SCons.Action._function_contents(func1)
@@ -2288,6 +2297,9 @@ def test_object_contents(self) -> None:
22882297
(3, 12): bytearray(
22892298
b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x97\x00d\x01|\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00d\x02|\x00_\x01\x00\x00\x00\x00\x00\x00\x00\x00y\x00),(),(),2, 2, 0, 0,(),(),(\x97\x00y\x00),(),()}}{{{a=a,b=b}}}"
22902299
),
2300+
(3, 13): bytearray(
2301+
b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x95\x00S\x01U\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00S\x02U\x00l\x01\x00\x00\x00\x00\x00\x00\x00\x00g\x00),(),(),2, 2, 0, 0,(),(),(\x95\x00g\x00),(),()}}{{{a=a,b=b}}}"
2302+
),
22912303
}
22922304

22932305
self.assertEqual(c, expected[sys.version_info[:2]])
@@ -2324,6 +2336,9 @@ def test_code_contents(self) -> None:
23242336
(3, 12): bytearray(
23252337
b'0, 0, 0, 0,(Hello, World!),(print),(\x97\x00\x02\x00e\x00d\x00\xab\x01\x00\x00\x00\x00\x00\x00\x01\x00y\x01)'
23262338
),
2339+
(3, 13): bytearray(
2340+
b'0, 0, 0, 0,(Hello, World!),(print),(\x95\x00\\\x00"\x00S\x005\x01\x00\x00\x00\x00\x00\x00 \x00g\x01)'
2341+
),
23272342
}
23282343

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

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ classifiers =
3333
Programming Language :: Python :: 3.10
3434
Programming Language :: Python :: 3.11
3535
Programming Language :: Python :: 3.12
36+
Programming Language :: Python :: 3.13
3637
Environment :: Console
3738
Intended Audience :: Developers
3839
License :: OSI Approved :: MIT License

0 commit comments

Comments
 (0)