Skip to content

Commit

Permalink
Add Python 3.13 support
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Nov 12, 2024
1 parent 63fdaff commit 36f86da
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
lint:
strategy:
matrix:
py-version: [ {semantic: '3.12', tox: 'py312'} ]
py-version: [ {semantic: '3.13', tox: 'py313'} ]
name: Lint ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
needs: [lint]
strategy:
matrix:
py-version: [ {semantic: '3.12', tox: 'py312'} ]
py-version: [ {semantic: '3.13', tox: 'py313'} ]
name: Type Check ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand All @@ -131,7 +131,7 @@ jobs:
needs: [lint]
strategy:
matrix:
py-version: [ {semantic: '3.12', tox: 'py312'} ]
py-version: [ {semantic: '3.13', tox: 'py313'} ]
name: Audit ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
needs: [typecheck, audit]
strategy:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'}, {semantic: '3.12', tox: 'py312'} ]
py-version: [ {semantic: '3.10', tox: 'py310'}, {semantic: '3.13', tox: 'py313'} ]
name: Full Tests ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/regular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'},
{semantic: '3.11', tox: 'py311'},
{semantic: '3.12', tox: 'py312'} ]
{semantic: '3.12', tox: 'py312'},
{semantic: '3.13', tox: 'py313'} ]
name: Lint ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand All @@ -74,7 +75,8 @@ jobs:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'},
{semantic: '3.11', tox: 'py311'},
{semantic: '3.12', tox: 'py312'} ]
{semantic: '3.12', tox: 'py312'},
{semantic: '3.13', tox: 'py313'} ]
name: Type Check ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand All @@ -95,7 +97,8 @@ jobs:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'},
{semantic: '3.11', tox: 'py311'},
{semantic: '3.12', tox: 'py312'} ]
{semantic: '3.12', tox: 'py312'},
{semantic: '3.13', tox: 'py313'} ]
name: Audit ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand All @@ -116,7 +119,8 @@ jobs:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'},
{semantic: '3.11', tox: 'py311'},
{semantic: '3.12', tox: 'py312'} ]
{semantic: '3.12', tox: 'py312'},
{semantic: '3.13', tox: 'py313'} ]
name: Core Tests ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand All @@ -137,7 +141,8 @@ jobs:
matrix:
py-version: [ {semantic: '3.10', tox: 'py310'},
{semantic: '3.11', tox: 'py311'},
{semantic: '3.12', tox: 'py312'} ]
{semantic: '3.12', tox: 'py312'},
{semantic: '3.13', tox: 'py313'} ]
name: Full Tests ${{ matrix.py-version.semantic }}
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Clean
run: |
python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist")]'
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.12'
python-version: '3.13'
- name: Install test-package
run: |
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ baybe==${{ github.ref_name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- Support for Python 3.13
- `allow_missing` and `allow_extra` keyword arguments to `Objective.transform`
- Example for a traditional mixture
- `add_noise_to_perturb_degenerate_rows` utility
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ we recommend the following workflow:
You can retrieve all available environments via `tox list`.
For more information, see our [README about tests](https://github.com/emdgroup/baybe/blob/main/tests/README.md).

For instance, running all code tests in Python 3.12 can be achieved via:
For instance, running all code tests in Python 3.13 can be achieved via:
```console
tox -e fulltest-py312
tox -e fulltest-py313
```

Other tox tests that are useful to verify your work locally are `tox -e lint-py312`,
`tox -e mypy-py312` and `tox -e coretest-py312`.
Other tox tests that are useful to verify your work locally are `tox -e lint-py313`,
`tox -e mypy-py313` and `tox -e coretest-py313`.

If you want to challenge your machine, you can run all checks in all Python versions
in parallel via:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Typing :: Typed",
]
Expand Down
8 changes: 4 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ tox -e fulltest-py310
```
will run pytest on baybe with all optional features in python 3.10, while
```bash
tox -e coretest-py312
tox -e coretest-py313
```
will run pytest on baybe without additional features in python 3.12.
will run pytest on baybe without additional features in python 3.13.
```bash
tox -e lint-py312
tox -e lint-py313
```
will run the linters with python 3.12.
will run the linters with python 3.13.

For a full overview of all available environments, type:
```
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
min_version = 4.9
env_list = {fulltest,coretest,lint,mypy,audit}-py{310,311,312}
env_list = {fulltest,coretest,lint,mypy,audit}-py{310,311,312,313}
isolated_build = True

[testenv:fulltest,fulltest-py{310,311,312}]
[testenv:fulltest,fulltest-py{310,311,312,313}]
description = Run PyTest with all extra functionality
extras = chem,examples,lint,onnx,polars,simulation,test
passenv =
Expand All @@ -17,7 +17,7 @@ commands =
python --version
pytest -p no:warnings --cov=baybe --durations=5 {posargs}

[testenv:coretest,coretest-py{310,311,312}]
[testenv:coretest,coretest-py{310,311,312,313}]
description = Run PyTest with core functionality
extras = test
passenv =
Expand All @@ -31,7 +31,7 @@ commands =
python --version
pytest -p no:warnings --cov=baybe --durations=5 {posargs}

[testenv:lint,lint-py{310,311,312}]
[testenv:lint,lint-py{310,311,312,313}]
description = Run linters and format checkers
extras = lint,examples
skip_install = True
Expand All @@ -40,7 +40,7 @@ commands =
python --version
pre-commit run --all-files {posargs:--show-diff-on-failure}

[testenv:mypy,mypy-py{310,311,312}]
[testenv:mypy,mypy-py{310,311,312,313}]
description = Run mypy
extras = mypy
setenv =
Expand All @@ -49,7 +49,7 @@ commands =
python --version
mypy

[testenv:audit,audit-py{310,311,312}]
[testenv:audit,audit-py{310,311,312,313}]
description = Run pip-audit
extras = dev # audit entire environment
setenv =
Expand Down

0 comments on commit 36f86da

Please sign in to comment.