Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Python 3.13 #414

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# NOTES:
# - The map syntax used for matrix is flagged red but actually works
# - This runs everything in Python 3.12, except the fulltest which is also run in 3.10
# - Only coretest and fulltest environments are cached due to space limit

name: Continuous Integration
on:
push:
Expand Down Expand Up @@ -78,7 +73,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 +108,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 +126,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 +166,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
21 changes: 10 additions & 11 deletions .github/workflows/regular.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# NOTES:
# - The map syntax used for matrix is flagged red but actually works
# - This runs everything in Python 3.10, 3.11 and 3.12
# - Environments are **not** cached in order to perform a full end-to-end test
# (and due to space limit)

name: Regular Checks
on:
schedule:
Expand Down Expand Up @@ -53,7 +47,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 +69,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 +91,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 +113,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 +135,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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AVHopp @Scienfitz: The PR is basically ready for review. Cannot be merged yet, though, since not all of our deps support 3.13 at the moment. Currently, the install fails for onnxruntime but I've found in their issues that it'll be shipped in the next release, so probably just a matter of days. Once that passes, the pipeline will tell us if there are other unsupported packages. But no need to change anything on our end (I hope)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for understanding: Lockfile check obviously fails since the dependencies change, right?

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
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ we recommend the following workflow:
1. Clone a [fork](https://github.com/emdgroup/BayBE/fork) of the repository to
your local machine.

1. Create and activate a virtual python environment using one of the supported
python versions.
1. Create and activate a virtual Python environment using one of the supported
Python versions.

1. Change into the root folder of the cloned repository and install an editable version
including all development dependencies:
Expand Down 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
Loading