Skip to content

Commit

Permalink
Support Python 3.13 (#539)
Browse files Browse the repository at this point in the history
Test Python 3.13 in CI
Add Python 3.13 to package metadata.

Upload coverage reports for all Python versions.

Fix test related to support Python 3.13:
Use docstring straight up in test.

Remove upper minor Python version limit in package metadata.
This will make it easier to test with future Python 3 versions
  • Loading branch information
CasperWA authored Oct 18, 2024
1 parent 9108049 commit 9cdc799
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

services:
redis:
Expand Down Expand Up @@ -114,20 +114,28 @@ jobs:
pytest --cov-report=xml:strategies.xml --cov=oteapi/strategies
- name: Upload coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core'
if: github.repository == 'EMMC-ASBL/oteapi-core'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
flags: linux
env_vars: OS,PYTHON
env:
OS: Linux
PYTHON: ${{ matrix.python-version }}

- name: Upload strategies coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core'
if: github.repository == 'EMMC-ASBL/oteapi-core'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: strategies.xml
flags: linux-strategies
env_vars: OS,PYTHON
env:
OS: Linux
PYTHON: ${{ matrix.python-version }}

pytest-win:
name: pytest (windows-py${{ matrix.python-version }})
Expand All @@ -136,7 +144,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -167,17 +175,25 @@ jobs:
pytest --cov-report=xml:strategies.xml --cov=oteapi/strategies --durations=10
- name: Upload coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core'
if: github.repository == 'EMMC-ASBL/oteapi-core'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
flags: windows
env_vars: OS,PYTHON
env:
OS: Windows
PYTHON: ${{ matrix.python-version }}

- name: Upload strategies coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core'
if: github.repository == 'EMMC-ASBL/oteapi-core'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: strategies.xml
flags: windows-strategies
env_vars: OS,PYTHON
env:
OS: Windows
PYTHON: ${{ matrix.python-version }}
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
keywords = ["OTE", "OTE-API"]
requires-python = ">=3.9,<3.13"
requires-python = "~=3.9"
dynamic = ["version"]

dependencies = [
Expand All @@ -35,7 +36,7 @@ dependencies = [
"celery>=5.3.5,<6",
"openpyxl>=3.1.2,<4",
"Pillow>=10.1.0,<11",
"psycopg~=3.2.1",
"psycopg[binary]~=3.2.1",
"pysftp~=0.2.9",
"requests>=2.31.0,<3",

Expand Down
14 changes: 2 additions & 12 deletions tests/models/test_triplestoreconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ def test_triplestoreconfig() -> None:
from oteapi.models.triplestoreconfig import TripleStoreConfig
from oteapi.settings import settings

description = """TripleStore Configuration.
This is a configuration for the
[`TripleStore`][oteapi.triplestore.triplestore.TripleStore].
This class should not be used directly as a configuration object
for a strategy object, but only as a configuration field inside
a configuration object.
"""

config = {
"agraphHost": "localhost",
"agraphPort": 8080,
Expand All @@ -45,7 +35,7 @@ def test_triplestoreconfig() -> None:
"user": "**********",
"password": "**********",
"configuration": {},
"description": description,
"description": TripleStoreConfig.__doc__,
"repositoryName": "test",
"agraphHost": "localhost",
"agraphPort": 8080,
Expand All @@ -54,7 +44,7 @@ def test_triplestoreconfig() -> None:
"user": "abc",
"password": "pass",
"configuration": {},
"description": description,
"description": TripleStoreConfig.__doc__,
"repositoryName": "test",
"agraphHost": "localhost",
"agraphPort": 8080,
Expand Down

0 comments on commit 9cdc799

Please sign in to comment.