diff --git a/.github/workflows/macos-x86.yaml b/.github/workflows/macos-x86.yaml new file mode 100644 index 00000000..638d0cf3 --- /dev/null +++ b/.github/workflows/macos-x86.yaml @@ -0,0 +1,104 @@ +# This file is part of tad-mctc. +# +# SPDX-Identifier: Apache-2.0 +# Copyright (C) 2024 Grimme Group +# +# 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 x86) + +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-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 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 + # + # Wheels for macOS x86_64 are deprecated since 2.3.0 + # + # 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" + 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" + - 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 }}-nolibcint diff --git a/.github/workflows/ubuntu-pytorch-1.yaml b/.github/workflows/ubuntu-pytorch-1.yaml index e35c52e2..bdddd281 100644 --- a/.github/workflows/ubuntu-pytorch-1.yaml +++ b/.github/workflows/ubuntu-pytorch-1.yaml @@ -85,7 +85,7 @@ jobs: run: echo "TOXENV is set to '${{ env.TOXENV }}'." - name: Unittests with tox - run: tox -e ${{ env.TOXENV }} + run: tox -e ${{ env.TOXENV }}-libcint - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 26287947..13b405f2 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -86,7 +86,7 @@ jobs: run: echo "TOXENV is set to '${{ env.TOXENV }}'." - name: Unittests with tox - run: tox -e ${{ env.TOXENV }} + run: tox -e ${{ env.TOXENV }}-libcint - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/setup.cfg b/setup.cfg index d291616f..c4b70658 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,6 @@ install_requires = scipy tad-dftd3>=0.3.0 tad-dftd4>=0.2.0 - tad-libcint>=0.1.0 tad-mctc>=0.2.0 tad-multicharge tomli @@ -75,6 +74,8 @@ dev = pytest-xdist pyyaml tox +libcint = + tad-libcint>=0.1.0 tox = covdefaults pyscf diff --git a/test/test_calculator/test_cache/test_properties.py b/test/test_calculator/test_cache/test_properties.py index 8524919a..60cf2509 100644 --- a/test/test_calculator/test_cache/test_properties.py +++ b/test/test_calculator/test_cache/test_properties.py @@ -24,11 +24,7 @@ import torch from dxtb import GFN1_XTB -from dxtb._src.calculators.properties.vibration import ( - IRResult, - RamanResult, - VibResult, -) +from dxtb._src.calculators.properties.vibration import IRResult, VibResult from dxtb._src.exlibs.available import has_libcint from dxtb._src.typing import DD, Literal, Tensor from dxtb.calculators import ( diff --git a/tox.ini b/tox.ini index d7d82f03..3f4eb551 100644 --- a/tox.ini +++ b/tox.ini @@ -18,11 +18,11 @@ min_version = 4.0 isolated_build = True envlist = - py38-torch{1110,1121,1131,201,212,222,231,240}, - py39-torch{1110,1121,1131,201,212,222,231,240}, - py310-torch{1110,1121,1131,201,212,222,231,240}, - py311-torch{1131,201,212,222,231,240} - py312-torch{222,231,240} + py38-torch{1110,1121,1131,201,212,222,231,240}-{nolibcint,libcint}, + py39-torch{1110,1121,1131,201,212,222,231,240}-{nolibcint,libcint}, + py310-torch{1110,1121,1131,201,212,222,231,240}-{nolibcint,libcint}, + py311-torch{1131,201,212,222,231,240}-{nolibcint,libcint}, + py312-torch{222,231,240}-{nolibcint,libcint} [testenv] setenv = @@ -44,7 +44,11 @@ deps = torch230: torch==2.3.0 torch231: torch==2.3.1 torch240: torch==2.4.0 - .[tox] + +extras = + tox + libcint: libcint + commands = pytest -vv {posargs: \ -m "not large" \