diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index e55819e..a908509 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -44,12 +44,15 @@ jobs: # only test oldest and newest version of torch torch-version: ["1.11.0", "2.2.2"] exclude: + # Check latest versions here: https://download.pytorch.org/whl/torch/ + # # PyTorch now fully supports Python=<3.11 # see: https://github.com/pytorch/pytorch/issues/86566 # - # PyTorch does not support Python 3.12 (all platforms) + # PyTorch does now support Python 3.12 (macOS only 2.2) # see: https://github.com/pytorch/pytorch/issues/110436 - python-version: "3.12" + torch-version: "1.11.0" # PyTorch<1.13.0 does only support Python=<3.10 # On macOS and Windows, 1.13.x is also not supported for Python>=3.10 - python-version: "3.11" diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 47b48c3..68c6d06 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -41,14 +41,25 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2"] + torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1"] exclude: + # Check latest versions here: https://download.pytorch.org/whl/torch/ + # # PyTorch now fully supports Python=<3.11 # see: https://github.com/pytorch/pytorch/issues/86566 # - # PyTorch does not support Python 3.12 (all platforms) + # PyTorch does now support Python 3.12 (Linux) for 2.2.0 and newer # see: https://github.com/pytorch/pytorch/issues/110436 - python-version: "3.12" + torch-version: "1.11.0" + - python-version: "3.12" + torch-version: "1.12.1" + - python-version: "3.12" + torch-version: "1.13.1" + - python-version: "3.12" + torch-version: "2.0.1" + - python-version: "3.12" + torch-version: "2.1.2" # PyTorch<1.13.0 does only support Python=<3.10 - python-version: "3.11" torch-version: "1.11.0" diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 883afae..791106e 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -44,13 +44,15 @@ jobs: # only test oldest and newest version of torch torch-version: ["1.11.0", "2.2.2"] exclude: + # Check latest versions here: https://download.pytorch.org/whl/torch/ + # # PyTorch now fully supports Python=<3.11 # see: https://github.com/pytorch/pytorch/issues/86566 # # PyTorch does not support Python 3.12 (all platforms) # see: https://github.com/pytorch/pytorch/issues/110436 - - os: windows-latest - python-version: "3.12" + - python-version: "3.12" + torch-version: "1.11.0" # PyTorch<1.13.0 does only support Python=<3.10 - python-version: "3.11" torch-version: "1.11.0" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96b650f..54f44e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: ] - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py37-plus, --keep-runtime-typing] diff --git a/setup.cfg b/setup.cfg index 7401d3d..1e448dc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython project_urls = Documentation = https://tad-dftd3.readthedocs.io/en/latest/ @@ -23,10 +24,10 @@ project_urls = [options] packages = find: install_requires = - numpy + numpy<2 tad-mctc - torch -python_requires = >=3.8 + torch>=1.11,<2.4 +python_requires = >=3.8, <3.13 include_package_data = True package_dir = =src diff --git a/src/tad_dftd3/__version__.py b/src/tad_dftd3/__version__.py index 25dbdbf..eb4aebe 100644 --- a/src/tad_dftd3/__version__.py +++ b/src/tad_dftd3/__version__.py @@ -15,4 +15,4 @@ """ Version module for *tad-dftd3*. """ -__version__ = "0.2.2" +__version__ = "0.3.0" diff --git a/test/conftest.py b/test/conftest.py index d5b38c2..6f2c6fa 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -35,6 +35,15 @@ """Name of Device.""" +# A bug in PyTorch 2.3.0 and 2.3.1 somehow requires manual import of +# `torch._dynamo` to avoid errors with functorch in custom backward +# functions. See https://github.com/pytorch/pytorch/issues/128607. +from tad_mctc._version import __tversion__ + +if __tversion__ in ((2, 3, 0), (2, 3, 1)): + import torch._dynamo + + def pytest_addoption(parser: pytest.Parser) -> None: """Set up additional command line options.""" diff --git a/tox.ini b/tox.ini index 0c67add..cd0b773 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,7 @@ envlist = py39-torch{1110,1121,1131,201,212,222}, py310-torch{1110,1121,1131,201,212,222}, py311-torch{1131,201,212,221} + py312-torch{222,231} [testenv] setenv = @@ -39,6 +40,8 @@ deps = torch220: torch==2.2.0 torch221: torch==2.2.1 torch222: torch==2.2.2 + torch230: torch==2.3.0 + torch231: torch==2.3.1 .[tox] commands = pytest -vv {posargs: \