Skip to content

Commit

Permalink
fix(Python): Support Python 3.13 (#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmcdonald3 authored Nov 5, 2024
1 parent 3e56406 commit 000baed
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/library_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
python-version: ["3.11"]
python-version: ["3.11", "3.13"]
os: [
# TODO fix Dafny-generated tests on Windows;
# the sys.path workaround for generated Dafny doesn't work on Windows.
Expand Down
2 changes: 1 addition & 1 deletion AwsCryptographicMaterialProviders/runtimes/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests}
py{311,312,313}-{dafnytests}
docs

[testenv:base-command]
Expand Down
2 changes: 1 addition & 1 deletion AwsCryptographyPrimitives/runtimes/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests,functional}
py{311,312,313}-{dafnytests,functional}

[testenv:base-command]
commands = poetry run pytest -l {posargs}
Expand Down
2 changes: 1 addition & 1 deletion ComAmazonawsDynamodb/runtimes/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests}
py{311,312,313}-{dafnytests}

[testenv:base-command]
commands = poetry run pytest -l {posargs}
Expand Down
2 changes: 1 addition & 1 deletion ComAmazonawsKms/runtimes/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests}
py{311,312,313}-{dafnytests}

[testenv:base-command]
commands = poetry run pytest -l {posargs}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,9 @@
However, if a Unicode-escaped character is outside the BMP, Python internally represents it
as a Unicode-escaped character using surrogate pairs.
ex.
"\uD808\uDC00" == '𒀀' --> ord('𒀀') == 73728 --> 73728 > 65535 --> outside BMP
Since "\uD808\uDC00" is outside the BMP, Python internally represents it as "\uD808\uDC00":
```
>>> s = "\uD808\uDC00"
>>> s
'\ud808\udc00'
```
Dafny expects its strings to be UTF-16 code units.
However, the `.decode()` method with 'surrogatepass' leaves '\ud808\udc00' as '𒀀',
However, the `.decode()` method with 'surrogatepass' leaves surrogates pairs as their Unicode representations,
which, if passed directly to Dafny, will be interpreted as a single UTF-32 code unit,
instead of the desired two UTF-16 code units.
Expand Down
2 changes: 1 addition & 1 deletion StandardLibrary/runtimes/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests}
py{311,312,313}-{dafnytests}

[testenv:base-command]
commands = poetry run pytest -l {posargs}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
isolated_build = True
envlist =
py{311,312}-{dafnytests,cli}
py{311,312,313}-{dafnytests,cli}

[testenv:dafnytests]
skip_install = true
Expand Down

0 comments on commit 000baed

Please sign in to comment.