diff --git a/.github/workflows/macos-arm.yaml b/.github/workflows/macos-arm.yaml new file mode 100644 index 0000000..9eb196e --- /dev/null +++ b/.github/workflows/macos-arm.yaml @@ -0,0 +1,102 @@ +# This file is part of tad-dftd3. +# SPDX-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Tests (macOS arm) + +on: + push: + branches: + - main + - master + paths-ignore: + - "doc*/**" + - "./*.ya?ml" + - "**/*.md" + - "**/*.rst" + + pull_request: + paths-ignore: + - "doc*/**" + - "./*.ya?ml" + - "**/*.md" + - "**/*.rst" + + workflow_dispatch: + +jobs: + main: + strategy: + fail-fast: false + matrix: + os: [macos-14] + # Python 3.8/3.9 is not on macos-latest (macos-14-arm64) + # https://github.com/actions/setup-python/issues/696 + python-version: ["3.10", "3.11"] + # only test oldest and newest version of torch + torch-version: ["1.11.0", "2.4.1"] + exclude: + # Check latest versions here: https://download.pytorch.org/whl/torch/ + # + # PyTorch issues: + # 3.11: https://github.com/pytorch/pytorch/issues/86566 + # 3.12: https://github.com/pytorch/pytorch/issues/110436 + # 3.13: https://github.com/pytorch/pytorch/issues/1302496 + # + # PyTorch<2.2 does only support Python<3.12 (all platforms) + - 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<2.0 does only support Python<3.11 (macOS and Windows) + - python-version: "3.11" + torch-version: "1.11.0" + - python-version: "3.11" + torch-version: "1.12.1" + - python-version: "3.11" + torch-version: "1.13.1" + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash {0} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install tox + + - name: Determine TOXENV + run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV + + - name: Print TOXENV + run: echo "TOXENV is set to '${{ env.TOXENV }}'." + + - name: Unittests with tox + run: tox -e ${{ env.TOXENV }} diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos-x86.yaml similarity index 72% rename from .github/workflows/macos.yaml rename to .github/workflows/macos-x86.yaml index a908509..d8f1660 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos-x86.yaml @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -name: Tests (macOS) +name: Tests (macOS x86) on: push: @@ -39,34 +39,38 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: [macos-12, macos-13] + python-version: ["3.8", "3.9", "3.10", "3.11"] # 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 issues: + # 3.11: https://github.com/pytorch/pytorch/issues/86566 + # 3.12: https://github.com/pytorch/pytorch/issues/110436 + # 3.13: https://github.com/pytorch/pytorch/issues/130249 # - # PyTorch does now support Python 3.12 (macOS only 2.2) - # see: https://github.com/pytorch/pytorch/issues/110436 + # Wheels for macOS x86_64 are deprecated since 2.3.0 + # + # PyTorch<2.2 does only support Python<3.12 (all platforms) - 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.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<2.0 does only support Python<3.11 (macOS and Windows) - python-version: "3.11" torch-version: "1.11.0" - python-version: "3.11" torch-version: "1.12.1" - python-version: "3.11" torch-version: "1.13.1" - # Python 3.8/3.9 is not on macos-latest (macos-14-arm64) - # https://github.com/actions/setup-python/issues/696 - - os: macos-14 - python-version: "3.8" - - os: macos-14 - python-version: "3.9" runs-on: ${{ matrix.os }} diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 68c6d06..dee10b1 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -41,15 +41,16 @@ 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", "2.3.1"] + torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1", "2.4.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 issues: + # 3.11: https://github.com/pytorch/pytorch/issues/86566 + # 3.12: https://github.com/pytorch/pytorch/issues/110436 + # 3.13: https://github.com/pytorch/pytorch/issues/130249 # - # PyTorch does now support Python 3.12 (Linux) for 2.2.0 and newer - # see: https://github.com/pytorch/pytorch/issues/110436 + # PyTorch<2.2.0 does only support Python<3.12 (all platforms) - python-version: "3.12" torch-version: "1.11.0" - python-version: "3.12" @@ -60,7 +61,7 @@ jobs: torch-version: "2.0.1" - python-version: "3.12" torch-version: "2.1.2" - # PyTorch<1.13.0 does only support Python=<3.10 + # PyTorch<1.13.0 does only support Python<3.11 (Linux) - python-version: "3.11" torch-version: "1.11.0" - python-version: "3.11" diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 791106e..ea04006 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -40,27 +40,34 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11"] # only test oldest and newest version of torch - torch-version: ["1.11.0", "2.2.2"] + torch-version: ["1.11.0", "2.4.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 issues: + # 3.11: https://github.com/pytorch/pytorch/issues/86566 + # 3.12: https://github.com/pytorch/pytorch/issues/110436 + # 3.13: https://github.com/pytorch/pytorch/issues/130249 # - # PyTorch does not support Python 3.12 (all platforms) - # see: https://github.com/pytorch/pytorch/issues/110436 + # PyTorch<2.2.0 does only support Python<3.12 (all platforms) - python-version: "3.12" torch-version: "1.11.0" - # PyTorch<1.13.0 does only support Python=<3.10 + - 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<2.0.0 does only support Python<3.11 (macOS and Windows) - python-version: "3.11" torch-version: "1.11.0" - python-version: "3.11" torch-version: "1.12.1" - # On macOS and Windows, 1.13.x is also not supported for Python>=3.10 - - os: windows-latest - python-version: "3.11" + - python-version: "3.11" torch-version: "1.13.1" runs-on: ${{ matrix.os }} diff --git a/README.rst b/README.rst index 6320920..d8212f0 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,8 @@ Torch autodiff for DFT-D3 |release| |license| |testubuntu| -|testmacos| +|testmacos_x86| +|testmacos_arm| |testwindows| |docs| |coverage| @@ -307,9 +308,13 @@ terms or conditions. :target: https://github.com/dftd3/tad-dftd3/actions/workflows/ubuntu.yaml :alt: Tests Ubuntu -.. |testmacos| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/macos.yaml/badge.svg - :target: https://github.com/dftd3/tad-dftd3/actions/workflows/macos.yaml - :alt: Tests macOS +.. |testmacos_x86| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/macos-x86.yaml/badge.svg + :target: https://github.com/dftd3/tad-dftd3/actions/workflows/macos-x86.yaml + :alt: Tests macOS (x86) + +.. |testmacos_arm| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/macos-arm.yaml/badge.svg + :target: https://github.com/dftd3/tad-dftd3/actions/workflows/macos-arm.yaml + :alt: Tests macOS (ARM) .. |testwindows| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/windows.yaml/badge.svg :target: https://github.com/dftd3/tad-dftd3/actions/workflows/windows.yaml diff --git a/environment.yml b/environment.yaml similarity index 90% rename from environment.yml rename to environment.yaml index 3b10d90..df20f93 100644 --- a/environment.yml +++ b/environment.yaml @@ -18,8 +18,7 @@ channels: - conda-forge - pytorch dependencies: - - numpy - - python>=3.8 - - pytorch>=1.11.0 - - pip: - - tad-mctc + - numpy<2 + - python>=3.8,<3.13 + - pytorch>=1.11.0,<2.5 + - tad-mctc diff --git a/setup.cfg b/setup.cfg index 1e448dc..ec16c74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,10 +4,18 @@ version = attr: tad_dftd3.__version__.__version__ description = Torch autodiff DFT-D3 implementation long_description = file: README.rst long_description_content_type = text/x-rst +author = "Sebastian Ehlert, Marvin Friede" license = Apache-2.0 license_files = LICENSE classifiers = + Intended Audience :: Developers + Intended Audience :: Science/Research License :: OSI Approved :: Apache Software License + Natural Language :: English + Operating System :: MacOS + Operating System :: Microsoft :: Windows + Operating System :: POSIX + Operating System :: POSIX :: Linux Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3.8 @@ -16,6 +24,8 @@ classifiers = Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Chemistry + Typing :: Typed project_urls = Documentation = https://tad-dftd3.readthedocs.io/en/latest/ Source Code = https://github.com/dftd3/tad-dftd3 @@ -26,7 +36,7 @@ packages = find: install_requires = numpy<2 tad-mctc - torch>=1.11,<2.4 + torch>=1.11,<2.5 python_requires = >=3.8, <3.13 include_package_data = True package_dir = diff --git a/tox.ini b/tox.ini index cd0b773..01ddbff 100644 --- a/tox.ini +++ b/tox.ini @@ -17,15 +17,16 @@ min_version = 4.0 isolated_build = True envlist = - py38-torch{1110,1121,1131,201,212,222}, - 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} + py38-torch{1110,1121,1131,201,212,222,231,241}, + py39-torch{1110,1121,1131,201,212,222,231,241}, + py310-torch{1110,1121,1131,201,212,222,231,241}, + py311-torch{1131,201,212,222,231,241} + py312-torch{222,231,241} [testenv] setenv = PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://download.pytorch.org/whl/cpu} + deps = torch1110: torch==1.11.0 torch1120: torch==1.12.0 @@ -42,7 +43,11 @@ deps = torch222: torch==2.2.2 torch230: torch==2.3.0 torch231: torch==2.3.1 + torch240: torch==2.4.0 + torch241: torch==2.4.1 + torch250: torch==2.5.0 .[tox] + commands = pytest -vv {posargs: \ -n logical \