Skip to content

Commit 000baed

Browse files
fix(Python): Support Python 3.13 (#953)
1 parent 3e56406 commit 000baed

File tree

8 files changed

+8
-17
lines changed
  • .github/workflows
  • AwsCryptographicMaterialProviders/runtimes/python
  • AwsCryptographyPrimitives/runtimes/python
  • ComAmazonawsDynamodb/runtimes/python
  • ComAmazonawsKms/runtimes/python
  • StandardLibrary/runtimes/python
  • TestVectorsAwsCryptographicMaterialProviders/runtimes/python

8 files changed

+8
-17
lines changed

.github/workflows/library_python_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
AwsCryptographicMaterialProviders,
2929
TestVectorsAwsCryptographicMaterialProviders,
3030
]
31-
python-version: ["3.11"]
31+
python-version: ["3.11", "3.13"]
3232
os: [
3333
# TODO fix Dafny-generated tests on Windows;
3434
# the sys.path workaround for generated Dafny doesn't work on Windows.

AwsCryptographicMaterialProviders/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests}
4+
py{311,312,313}-{dafnytests}
55
docs
66

77
[testenv:base-command]

AwsCryptographyPrimitives/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests,functional}
4+
py{311,312,313}-{dafnytests,functional}
55

66
[testenv:base-command]
77
commands = poetry run pytest -l {posargs}

ComAmazonawsDynamodb/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests}
4+
py{311,312,313}-{dafnytests}
55

66
[testenv:base-command]
77
commands = poetry run pytest -l {posargs}

ComAmazonawsKms/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests}
4+
py{311,312,313}-{dafnytests}
55

66
[testenv:base-command]
77
commands = poetry run pytest -l {posargs}

StandardLibrary/runtimes/python/src/smithy_dafny_standard_library/internaldafny/extern/UTF8.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,9 @@
2020
2121
However, if a Unicode-escaped character is outside the BMP, Python internally represents it
2222
as a Unicode-escaped character using surrogate pairs.
23-
ex.
24-
"\uD808\uDC00" == '𒀀' --> ord('𒀀') == 73728 --> 73728 > 65535 --> outside BMP
25-
Since "\uD808\uDC00" is outside the BMP, Python internally represents it as "\uD808\uDC00":
26-
27-
```
28-
>>> s = "\uD808\uDC00"
29-
>>> s
30-
'\ud808\udc00'
31-
```
3223
3324
Dafny expects its strings to be UTF-16 code units.
34-
However, the `.decode()` method with 'surrogatepass' leaves '\ud808\udc00' as '𒀀',
25+
However, the `.decode()` method with 'surrogatepass' leaves surrogates pairs as their Unicode representations,
3526
which, if passed directly to Dafny, will be interpreted as a single UTF-32 code unit,
3627
instead of the desired two UTF-16 code units.
3728

StandardLibrary/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests}
4+
py{311,312,313}-{dafnytests}
55

66
[testenv:base-command]
77
commands = poetry run pytest -l {posargs}

TestVectorsAwsCryptographicMaterialProviders/runtimes/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
isolated_build = True
33
envlist =
4-
py{311,312}-{dafnytests,cli}
4+
py{311,312,313}-{dafnytests,cli}
55

66
[testenv:dafnytests]
77
skip_install = true

0 commit comments

Comments
 (0)