Skip to content

Commit c54116d

Browse files
authored
Merge pull request #571 from simvue-io/feature/support-3.13
Add Python3.13 Support and drop support for Python3.9
2 parents 14bfe2c + 425f154 commit c54116d

File tree

8 files changed

+416
-445
lines changed

8 files changed

+416
-445
lines changed

.github/workflows/test_client_macos.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
timeout-minutes: 30
1616
runs-on: macos-latest
1717
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Python 3.12
20-
uses: actions/setup-python@v3
18+
- uses: actions/checkout@v4
19+
- name: Set up Python 3.13
20+
uses: actions/setup-python@v5
2121
with:
22-
python-version: "3.12"
22+
python-version: "3.13"
2323
- name: Install dependencies
2424
run: |
2525
rm poetry.lock

.github/workflows/test_client_ubuntu.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ jobs:
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 30
2525
steps:
26-
- uses: actions/checkout@v3
27-
- name: Set up Python 3.12
28-
uses: actions/setup-python@v3
26+
- uses: actions/checkout@v4
27+
- name: Set up Python 3.13
28+
uses: actions/setup-python@v5
2929
with:
30-
python-version: "3.12"
30+
python-version: "3.13"
3131
- name: Install dependencies
3232
run: python -m pip install poetry
3333
- name: Test with pytest
3434
run: |
3535
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
3636
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
3737
poetry install --all-extras
38-
poetry run python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
38+
# poetry run python -m pip install torch --index-url https://download.pytorch.org/whl/cpu FIXME: PyTorch current broken for Python3.13
3939
poetry run pytest -x --cov --cov-report=xml tests/unit/ tests/refactor/ -m 'not scenario' -c /dev/null -p no:warnings -n 0
4040
- name: Upload coverage reports to Codecov
4141
run: |

.github/workflows/test_multiple_python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
timeout-minutes: 30
2323
strategy:
2424
matrix:
25-
python-version: ['3.9', '3.10', '3.11']
25+
python-version: ['3.10', '3.11', '3.12']
2626
steps:
2727
- uses: actions/checkout@v3
2828
- name: Set up Python ${{ matrix.python-version }}

poetry.lock

Lines changed: 394 additions & 427 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ keywords = [
3535
]
3636

3737
[tool.poetry.dependencies]
38-
python = "^3.9"
38+
python = "^3.10,<3.14"
3939
dill = "^0.3.7"
4040
requests = "^2.31.0"
4141
msgpack = "^1.0.7"
@@ -45,7 +45,6 @@ psutil = ">=5.9.8,<7.0.0"
4545
pydantic = "^2.5.3"
4646
pandas = "^2.2.0"
4747
plotly = {version = "^5.18.0", optional = true}
48-
numpy = ">=1.26.3,<3.0.0"
4948
matplotlib = {version = "^3.8.2", optional = true}
5049
typing_extensions = { version = "^4.11.0", python = "<3.10" }
5150
toml = "^0.10.2"
@@ -55,6 +54,7 @@ humanfriendly = "^10.0"
5554
tabulate = "^0.9.0"
5655
randomname = "^0.2.1"
5756
codecarbon = "^2.7.1"
57+
numpy = "^2.1.2"
5858

5959
[tool.poetry.extras]
6060
plot = ["matplotlib", "plotly"]

simvue/utilities.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import hashlib
33
import logging
44
import json
5+
import sys
56
import tabulate
67
import pydantic
78
import importlib.util
@@ -137,10 +138,15 @@ def wrapper(self, *args, **kwargs) -> typing.Any:
137138
raise RuntimeError(
138139
f"Plotting features require the '{extra_name}' extension to Simvue"
139140
)
140-
elif extra_name == "torch" and not importlib.util.find_spec("torch"):
141-
raise RuntimeError(
142-
"PyTorch features require the 'torch' module to be installed"
143-
)
141+
elif extra_name == "torch":
142+
if importlib.util.find_spec("torch"):
143+
raise RuntimeError(
144+
"PyTorch features require the 'torch' module to be installed"
145+
)
146+
if sys.version_info.minor > 12:
147+
raise RuntimeError(
148+
"PyTorch features are not yet supported for python>3.12"
149+
)
144150
elif extra_name not in EXTRAS:
145151
raise RuntimeError(f"Unrecognised extra '{extra_name}'")
146152
return class_func(self, *args, **kwargs) if class_func else None

tests/unit/test_pytorch_tensor_mime_type.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from simvue.serialization import serialize_object
2-
import torch
32
import pytest
43

54

tests/unit/test_pytorch_tensor_serialization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import torch
21
from simvue.serialization import serialize_object, deserialize_data
32
import pytest
43

0 commit comments

Comments
 (0)