Skip to content

Commit

Permalink
Add support for Pythons 3.12 and 3.13
Browse files Browse the repository at this point in the history
* Fix deserialization code to use a dedicated namespace instead of
  `locals`, due to new strictness from 3.13
* Bump GIM and `globus-compute-common` to versions that officially
  support 3.12 and 3.13
  * globusonline/globus-identity-mapping#25
  * globus/globus-compute-common#135
* Update test matrices in `tox.ini`s and `ci.yaml`
  • Loading branch information
chris-janidlo committed Nov 11, 2024
1 parent 2de8ef9 commit 2bbebdc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
name: "Test SDK on py${{ matrix.python-version }} x ${{ matrix.os }} "
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -78,7 +78,7 @@ jobs:
options: --health-cmd "rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_virtual_hosts && rabbitmq-diagnostics -q check_port_connectivity" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
name: "Test Endpoint on py${{ matrix.python-version }} x ${{ matrix.os }} "
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions changelog.d/20241111_160525_chris_new_pythons.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
New Functionality
^^^^^^^^^^^^^^^^^

- The ``globus-compute-sdk`` and ``globus-compute-endpoint`` packages now support
Python versions 3.12 and 3.13.
4 changes: 2 additions & 2 deletions compute_endpoint/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"requests>=2.31.0,<3",
"globus-sdk", # version will be bounded by `globus-compute-sdk`
"globus-compute-sdk==2.30.1",
"globus-compute-common==0.4.1",
"globus-identity-mapping==0.3.0",
"globus-compute-common==0.5.0",
"globus-identity-mapping==0.4.0",
# table printing used in list-endpoints
"texttable>=1.6.4,<2",
# although psutil does not declare itself to use semver, it appears to offer
Expand Down
2 changes: 1 addition & 1 deletion compute_endpoint/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{311,310,39}
envlist = py{313,312,311,310,39}
skip_missing_interpreters = true

[testenv]
Expand Down
10 changes: 6 additions & 4 deletions compute_sdk/globus_compute_sdk/serialize/concretes.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def serialize(self, data) -> str:
def deserialize(self, payload: str):
chomped = self.chomp(payload)
name, body = dill.loads(codecs.decode(chomped.encode(), "base64"))
exec(body)
return locals()[name]
exec_ns: dict = {}
exec(body, exec_ns)
return exec_ns[name]


class DillCodeTextInspect(SerializationStrategy):
Expand Down Expand Up @@ -102,8 +103,9 @@ def serialize(self, data) -> str:
def deserialize(self, payload: str):
chomped = self.chomp(payload)
name, body = dill.loads(codecs.decode(chomped.encode(), "base64"))
exec(body)
return locals()[name]
exec_ns: dict = {}
exec(body, exec_ns)
return exec_ns[name]


class PickleCode(SerializationStrategy):
Expand Down
2 changes: 1 addition & 1 deletion compute_sdk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# request sending and authorization tools
"requests>=2.31.0,<3",
"globus-sdk>=3.46.0,<4",
"globus-compute-common==0.4.1",
"globus-compute-common==0.5.0",
# dill is an extension of `pickle` to a wider array of native python types
# pin to the latest version, as 'dill' is not at 1.0 and does not have a clear
# versioning and compatibility policy
Expand Down
2 changes: 1 addition & 1 deletion compute_sdk/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{311,310,39}
envlist = py{313,312,311,310,39}
skip_missing_interpreters = true

[testenv]
Expand Down

0 comments on commit 2bbebdc

Please sign in to comment.