From d49bc5547024e4c9bdb5fb4741ec626e2621de64 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Thu, 28 May 2026 13:22:48 +0200 Subject: [PATCH 1/3] Re-enable Windows Rust tests --- .github/workflows/rust-tests.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 77ac7838..9a29bf23 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -51,21 +51,21 @@ jobs: cc: clang cmake-generator: Unix Makefiles - # - os: windows-2022 - # rust-version: stable - # rust-target: x86_64-pc-windows-msvc - # extra-name: " / MSVC" - # cxx: cl.exe - # cc: cl.exe - # cmake-generator: Visual Studio 17 2022 - - # - os: windows-2022 - # rust-version: stable - # rust-target: x86_64-pc-windows-gnu - # extra-name: " / MinGW" - # cxx: g++.exe - # cc: gcc.exe - # cmake-generator: MinGW Makefiles + - os: windows-2022 + rust-version: stable + rust-target: x86_64-pc-windows-msvc + extra-name: " / MSVC" + cxx: cl.exe + cc: cl.exe + cmake-generator: Visual Studio 17 2022 + + - os: windows-2022 + rust-version: stable + rust-target: x86_64-pc-windows-gnu + extra-name: " / MinGW" + cxx: g++.exe + cc: gcc.exe + cmake-generator: MinGW Makefiles steps: - name: install dependencies in container if: matrix.container == 'ubuntu:22.04' From 86135b947e28d2591138b8cd495f6c7fc14b5e6f Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Thu, 28 May 2026 13:55:01 +0200 Subject: [PATCH 2/3] [DEBUG] --- .github/workflows/ase-tests.yml | 120 ++-- .github/workflows/build-wheels.yml | 806 +++++++++++++-------------- .github/workflows/docs.yml | 132 ++--- .github/workflows/python-tests.yml | 170 +++--- .github/workflows/rust-tests.yml | 68 +-- .github/workflows/torch-tests.yml | 211 ++++--- .github/workflows/torchsim-tests.yml | 120 ++-- 7 files changed, 814 insertions(+), 813 deletions(-) diff --git a/.github/workflows/ase-tests.yml b/.github/workflows/ase-tests.yml index fd3fe5e0..465c30dc 100644 --- a/.github/workflows/ase-tests.yml +++ b/.github/workflows/ase-tests.yml @@ -1,60 +1,60 @@ -name: ASE integration - -on: - push: - branches: [main] - pull_request: - # Check all PR - -concurrency: - group: ase-tests-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - tests: - runs-on: ubuntu-24.04 - name: tests - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.13" - - - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.10 - with: - version: "v0.10.0" - - - name: Setup sccache environnement variables - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - - - name: install tests dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox coverage - - - name: run tests - run: tox -e ase-tests - env: - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - - - name: combine Python coverage files - shell: bash - run: | - coverage combine .tox/*/.coverage - coverage xml - - - name: upload to codecov.io - uses: codecov/codecov-action@v6 - with: - fail_ci_if_error: true - files: coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} +# name: ASE integration + +# on: +# push: +# branches: [main] +# pull_request: +# # Check all PR + +# concurrency: +# group: ase-tests-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +# jobs: +# tests: +# runs-on: ubuntu-24.04 +# name: tests +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: setup Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.13" + +# - name: Setup sccache +# uses: mozilla-actions/sccache-action@v0.0.10 +# with: +# version: "v0.10.0" + +# - name: Setup sccache environnement variables +# run: | +# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV +# echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV +# echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV +# echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV + +# - name: install tests dependencies +# run: | +# python -m pip install --upgrade pip +# python -m pip install tox coverage + +# - name: run tests +# run: tox -e ase-tests +# env: +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu + +# - name: combine Python coverage files +# shell: bash +# run: | +# coverage combine .tox/*/.coverage +# coverage xml + +# - name: upload to codecov.io +# uses: codecov/codecov-action@v6 +# with: +# fail_ci_if_error: true +# files: coverage.xml +# token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 564e0440..37a1781b 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,403 +1,403 @@ -name: Build Python wheels - -on: - push: - tags: ["*"] - pull_request: - paths: - # build wheels in PR if this file changed - - '.github/workflows/build-wheels.yml' - # build wheels in PR if any of the build system files changed - - '**/VERSION' - - '**/setup.py' - - '**/pyproject.toml' - - '**/MANIFEST.in' - - '**/CMakeLists.txt' - schedule: - # check the build once a week on mondays - - cron: '0 10 * * 1' - - -concurrency: - group: python-wheels-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - - -jobs: - build-torch-wheels: - runs-on: ${{ matrix.os }} - name: ${{ matrix.name }} (torch v${{ matrix.torch-version }}) - strategy: - matrix: - os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15', 'windows-2022'] - arch: ['arm64', 'x86_64'] - torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10', '2.11', '2.12'] - exclude: - # remove mismatched arch-os combinations - - {os: windows-2022, arch: arm64} - - {os: ubuntu-24.04, arch: arm64} - - {os: macos-15, arch: x86_64} - - {os: ubuntu-24.04-arm, arch: x86_64} - include: - # add `cibw-arch` and `rust-target` to the different configurations - - name: x86_64 Linux - os: ubuntu-24.04 - arch: x86_64 - rust-target: x86_64-unknown-linux-gnu - cibw-arch: x86_64 - - name: arm64 Linux - os: ubuntu-24.04-arm - arch: arm64 - rust-target: aarch64-unknown-linux-gnu - cibw-arch: aarch64 - - name: arm64 macOS - os: macos-15 - arch: arm64 - rust-target: aarch64-apple-darwin - cibw-arch: arm64 - - name: x86_64 Windows - os: windows-2022 - arch: x86_64 - rust-target: x86_64-pc-windows-msvc - cibw-arch: AMD64 - # add the right python version image for each torch version - - {torch-version: '2.3', cibw-python: 'cp312-*'} - - {torch-version: '2.4', cibw-python: 'cp312-*'} - - {torch-version: '2.5', cibw-python: 'cp312-*'} - - {torch-version: '2.6', cibw-python: 'cp313-*'} - - {torch-version: '2.7', cibw-python: 'cp313-*'} - - {torch-version: '2.8', cibw-python: 'cp313-*'} - - {torch-version: '2.9', cibw-python: 'cp314-*'} - - {torch-version: '2.10', cibw-python: 'cp314-*'} - - {torch-version: '2.11', cibw-python: 'cp314-*'} - - {torch-version: '2.12', cibw-python: 'cp314-*'} - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - - name: install dependencies - run: python -m pip install cibuildwheel - - - name: build custom manylinux docker images - if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm' - run: | - docker buildx build \ - -t gcc11-manylinux_2_28_${{ matrix.cibw-arch }} \ - python/scripts/gcc11-manylinux_2_28_${{ matrix.cibw-arch }} - - - name: build metatomic-torch wheel - run: python -m cibuildwheel python/metatomic_torch - env: - CIBW_BUILD: ${{ matrix.cibw-python}} - CIBW_SKIP: "*musllinux*" - CIBW_ARCHS: ${{ matrix.cibw-arch }} - CIBW_BUILD_VERBOSITY: 1 - CIBW_MANYLINUX_X86_64_IMAGE: gcc11-manylinux_2_28_x86_64 - CIBW_MANYLINUX_AARCH64_IMAGE: gcc11-manylinux_2_28_aarch64 - # METATOMIC_NO_LOCAL_DEPS is set to 1 when building a tag of - # metatomic-torch, which will force to use the version of - # metatomic-core already released on PyPI. Otherwise, this will use - # the version of metatomic-core from git checkout (in case there are - # unreleased breaking changes). - # - # This means that when releasing a breaking change in metatomic-core, - # the full release should be available on PyPI before pushing the new - # metatomic-torch tag. - CIBW_ENVIRONMENT: > - METATOMIC_NO_LOCAL_DEPS=${{ startsWith(github.ref, 'refs/tags/metatomic-torch-v') && '1' || '0' }} - METATOMIC_TORCH_BUILD_WITH_TORCH_VERSION=${{ matrix.torch-version }}.* - PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu - MACOSX_DEPLOYMENT_TARGET=11 - # do not complain for missing shared libraries provided by other packages - CIBW_REPAIR_WHEEL_COMMAND_MACOS: | - delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel} - CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - auditwheel repair --exclude libmetatensor.so --exclude libmetatensor_torch.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libc10.so -w {dest_dir} {wheel} - - - uses: actions/upload-artifact@v7 - with: - name: torch-single-version-wheel-${{ matrix.torch-version }}-${{ matrix.os }}-${{ matrix.arch }} - path: ./wheelhouse/*.whl - - merge-torch-wheels: - needs: build-torch-wheels - runs-on: ubuntu-24.04 - name: merge metatomic-torch ${{ matrix.name }} - strategy: - matrix: - include: - - name: x86_64 Linux - os: ubuntu-24.04 - arch: x86_64 - - name: arm64 Linux - os: ubuntu-24.04-arm - arch: arm64 - - name: arm64 macOS - os: macos-15 - arch: arm64 - - name: x86_64 Windows - os: windows-2022 - arch: x86_64 - steps: - - uses: actions/checkout@v6 - - - name: Download wheels - uses: actions/download-artifact@v8 - with: - pattern: torch-single-version-wheel-*-${{ matrix.os }}-${{ matrix.arch }} - merge-multiple: false - path: dist - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - - name: install dependencies - run: python -m pip install twine wheel - - - name: merge wheels - run: | - # collect all torch versions used for the build - REQUIRES_TORCH=$(find dist -name "*.whl" -exec unzip -p {} "metatomic_torch-*.dist-info/METADATA" \; | grep "Requires-Dist: torch") - MERGED_TORCH_REQUIRE=$(python scripts/create-torch-versions-range.py "$REQUIRES_TORCH") - - echo MERGED_TORCH_REQUIRE=$MERGED_TORCH_REQUIRE - - # unpack all single torch versions wheels in the same directory - mkdir dist/unpacked - find dist -name "*.whl" -print -exec python -m wheel unpack --dest dist/unpacked/ {} ';' - - sed -i "s/Requires-Dist: torch.*/$MERGED_TORCH_REQUIRE/" dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA - - echo "\n\n METADATA = \n\n" - cat dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA - - # check the right metadata was added to the file. grep will exit with - # code `1` if the line is not found, which will stop CI - grep "$MERGED_TORCH_REQUIRE" dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA - - # repack the directory as a new wheel - mkdir wheelhouse - python -m wheel pack --dest wheelhouse/ dist/unpacked/* - - - name: check wheels with twine - run: twine check wheelhouse/* - - - uses: actions/upload-artifact@v7 - with: - name: torch-wheel-${{ matrix.os }}-${{ matrix.arch }} - path: ./wheelhouse/*.whl - - build-others: - name: Build other wheels/sdists - runs-on: ubuntu-24.04 - env: - METATOMIC_NO_LOCAL_DEPS: "1" - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - - name: install dependencies - run: python -m pip install wheel build twine - - - name: build metatomic-torch sdist - run: python -m build python/metatomic_torch --sdist --outdir=dist/ - - - name: build metatomic sdist and wheel - run: python -m build . --outdir=dist/ - - - name: build metatomic_ase sdist and wheel - run: python -m build python/metatomic_ase --outdir=dist/ - - - name: build metatomic_torchsim sdist and wheel - run: python -m build python/metatomic_torchsim --outdir=dist/ - - - name: check sdist and wheels with twine - run: twine check dist/*.tar.gz dist/*.whl - - - name: create C++ tarballs - run: | - ./scripts/package-torch.sh dist/cxx/ - - - uses: actions/upload-artifact@v7 - with: - name: others - path: | - dist/*.tar.gz - dist/cxx/*.tar.gz - dist/*.whl - - merge-and-release: - name: Merge and release wheels/sdists - needs: [merge-torch-wheels, build-others] - runs-on: ubuntu-24.04 - permissions: - contents: write - pull-requests: write - steps: - - name: Download metatomic-torch wheels - uses: actions/download-artifact@v8 - with: - path: wheels - pattern: torch-wheel-* - merge-multiple: true - - - name: Download other wheels and sdists - uses: actions/download-artifact@v8 - with: - path: wheels - name: others - - - name: Re-upload a single wheels artifact - uses: actions/upload-artifact@v7 - with: - name: wheels - path: | - wheels/* - wheels/cxx/* - - - name: Comment with download link - uses: PicoCentauri/comment-artifact@v1 - if: github.event.pull_request.head.repo.fork == false - with: - name: wheels - description: ⚙️ Download Python wheels for this pull-request (you can install these with pip) - - - name: upload to GitHub release (metatomic) - if: startsWith(github.ref, 'refs/tags/metatomic-v') - uses: softprops/action-gh-release@v3 - with: - files: | - wheels/metatomic-* - prerelease: ${{ contains(github.ref, '-rc') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: upload to GitHub release (metatomic-torch) - if: startsWith(github.ref, 'refs/tags/metatomic-torch-v') - uses: softprops/action-gh-release@v3 - with: - files: | - wheels/cxx/metatomic-torch-cxx-*.tar.gz - wheels/metatomic_torch-* - prerelease: ${{ contains(github.ref, '-rc') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: upload to GitHub release (metatomic-ase) - if: startsWith(github.ref, 'refs/tags/metatomic-ase-v') - uses: softprops/action-gh-release@v3 - with: - files: | - wheels/metatomic_ase-* - prerelease: ${{ contains(github.ref, '-rc') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: upload to GitHub release (metatomic-torchsim) - if: startsWith(github.ref, 'refs/tags/metatomic-torchsim-v') - uses: softprops/action-gh-release@v3 - with: - files: | - wheels/metatomic_torchsim-* - prerelease: ${{ contains(github.ref, '-rc') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test-build-external: - # This checks building the wheels with external libraries. This setup is - # mainly used for the conda packages metatensor-*-python, which use the - # libmetatensor-* conda packages to provide the native code. - runs-on: ${{ matrix.os }} - name: External libraries / ${{ matrix.os }} - defaults: - run: - shell: bash - strategy: - matrix: - include: - - os: ubuntu-24.04 - rust-target: x86_64-unknown-linux-gnu - torch-version: "2.12" - libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.12.0%2Bcpu.zip - - os: macos-15 - rust-target: aarch64-apple-darwin - torch-version: "2.12" - libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.12.0.zip - - os: windows-2022 - rust-target: x86_64-pc-windows-msvc - torch-version: "2.12" - libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.12.0%2Bcpu.zip - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - - name: setup environment - run: | - pip install build - echo "CMAKE_PREFIX_PATH=${RUNNER_TEMP//\\//}/usr" >> "$GITHUB_ENV" - - - name: setup libtorch - run: | - curl --output libtorch.zip ${{ matrix.libtorch-url }} - unzip -q libtorch.zip -d $CMAKE_PREFIX_PATH/ - mv $CMAKE_PREFIX_PATH/libtorch/* $CMAKE_PREFIX_PATH/ - - - name: setup libmetatensor - run: | - curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.2.0/metatensor-core-cxx-0.2.0.tar.gz - tar xf metatensor-core-cxx-0.2.0.tar.gz - cmake -B build-metatensor -S metatensor-core-cxx-0.2.0 \ - -DMETATENSOR_INSTALL_BOTH_STATIC_SHARED=OFF \ - -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ - -DCMAKE_BUILD_TYPE=Debug - cmake --build build-metatensor --config Debug - cmake --install build-metatensor --config Debug - - - name: setup libmetatensor-torch - run: | - curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-torch-v0.9.0/metatensor-torch-cxx-0.9.0.tar.gz - tar xf metatensor-torch-cxx-0.9.0.tar.gz - cmake -B build-metatensor-torch -S metatensor-torch-cxx-0.9.0 \ - -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ - -DCMAKE_BUILD_TYPE=Debug - cmake --build build-metatensor-torch --config Debug - cmake --install build-metatensor-torch --config Debug - - - name: build libmetatomic-torch - run: | - cmake -B build-metatomic-torch -S metatomic-torch \ - -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ - -DCMAKE_BUILD_TYPE=Debug - cmake --build build-metatomic-torch --config Debug - cmake --install build-metatomic-torch --config Debug - - - name: build metatomic-torch wheels - run: | - pip install build - - python -m build python/metatomic_torch --wheel --outdir=dist/ - unzip -l dist/metatomic_torch*.whl | grep "_external.py" - env: - METATOMIC_TORCH_PYTHON_USE_EXTERNAL_LIB: "ON" - METATOMIC_TORCH_BUILD_WITH_TORCH_VERSION: ${{ matrix.torch-version }}.* - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu +# name: Build Python wheels + +# on: +# push: +# tags: ["*"] +# pull_request: +# paths: +# # build wheels in PR if this file changed +# - '.github/workflows/build-wheels.yml' +# # build wheels in PR if any of the build system files changed +# - '**/VERSION' +# - '**/setup.py' +# - '**/pyproject.toml' +# - '**/MANIFEST.in' +# - '**/CMakeLists.txt' +# schedule: +# # check the build once a week on mondays +# - cron: '0 10 * * 1' + + +# concurrency: +# group: python-wheels-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + + +# jobs: +# build-torch-wheels: +# runs-on: ${{ matrix.os }} +# name: ${{ matrix.name }} (torch v${{ matrix.torch-version }}) +# strategy: +# matrix: +# os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15', 'windows-2022'] +# arch: ['arm64', 'x86_64'] +# torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10', '2.11', '2.12'] +# exclude: +# # remove mismatched arch-os combinations +# - {os: windows-2022, arch: arm64} +# - {os: ubuntu-24.04, arch: arm64} +# - {os: macos-15, arch: x86_64} +# - {os: ubuntu-24.04-arm, arch: x86_64} +# include: +# # add `cibw-arch` and `rust-target` to the different configurations +# - name: x86_64 Linux +# os: ubuntu-24.04 +# arch: x86_64 +# rust-target: x86_64-unknown-linux-gnu +# cibw-arch: x86_64 +# - name: arm64 Linux +# os: ubuntu-24.04-arm +# arch: arm64 +# rust-target: aarch64-unknown-linux-gnu +# cibw-arch: aarch64 +# - name: arm64 macOS +# os: macos-15 +# arch: arm64 +# rust-target: aarch64-apple-darwin +# cibw-arch: arm64 +# - name: x86_64 Windows +# os: windows-2022 +# arch: x86_64 +# rust-target: x86_64-pc-windows-msvc +# cibw-arch: AMD64 +# # add the right python version image for each torch version +# - {torch-version: '2.3', cibw-python: 'cp312-*'} +# - {torch-version: '2.4', cibw-python: 'cp312-*'} +# - {torch-version: '2.5', cibw-python: 'cp312-*'} +# - {torch-version: '2.6', cibw-python: 'cp313-*'} +# - {torch-version: '2.7', cibw-python: 'cp313-*'} +# - {torch-version: '2.8', cibw-python: 'cp313-*'} +# - {torch-version: '2.9', cibw-python: 'cp314-*'} +# - {torch-version: '2.10', cibw-python: 'cp314-*'} +# - {torch-version: '2.11', cibw-python: 'cp314-*'} +# - {torch-version: '2.12', cibw-python: 'cp314-*'} +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: Set up Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.14" + +# - name: install dependencies +# run: python -m pip install cibuildwheel + +# - name: build custom manylinux docker images +# if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm' +# run: | +# docker buildx build \ +# -t gcc11-manylinux_2_28_${{ matrix.cibw-arch }} \ +# python/scripts/gcc11-manylinux_2_28_${{ matrix.cibw-arch }} + +# - name: build metatomic-torch wheel +# run: python -m cibuildwheel python/metatomic_torch +# env: +# CIBW_BUILD: ${{ matrix.cibw-python}} +# CIBW_SKIP: "*musllinux*" +# CIBW_ARCHS: ${{ matrix.cibw-arch }} +# CIBW_BUILD_VERBOSITY: 1 +# CIBW_MANYLINUX_X86_64_IMAGE: gcc11-manylinux_2_28_x86_64 +# CIBW_MANYLINUX_AARCH64_IMAGE: gcc11-manylinux_2_28_aarch64 +# # METATOMIC_NO_LOCAL_DEPS is set to 1 when building a tag of +# # metatomic-torch, which will force to use the version of +# # metatomic-core already released on PyPI. Otherwise, this will use +# # the version of metatomic-core from git checkout (in case there are +# # unreleased breaking changes). +# # +# # This means that when releasing a breaking change in metatomic-core, +# # the full release should be available on PyPI before pushing the new +# # metatomic-torch tag. +# CIBW_ENVIRONMENT: > +# METATOMIC_NO_LOCAL_DEPS=${{ startsWith(github.ref, 'refs/tags/metatomic-torch-v') && '1' || '0' }} +# METATOMIC_TORCH_BUILD_WITH_TORCH_VERSION=${{ matrix.torch-version }}.* +# PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu +# MACOSX_DEPLOYMENT_TARGET=11 +# # do not complain for missing shared libraries provided by other packages +# CIBW_REPAIR_WHEEL_COMMAND_MACOS: | +# delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel} +# CIBW_REPAIR_WHEEL_COMMAND_LINUX: | +# auditwheel repair --exclude libmetatensor.so --exclude libmetatensor_torch.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libc10.so -w {dest_dir} {wheel} + +# - uses: actions/upload-artifact@v7 +# with: +# name: torch-single-version-wheel-${{ matrix.torch-version }}-${{ matrix.os }}-${{ matrix.arch }} +# path: ./wheelhouse/*.whl + +# merge-torch-wheels: +# needs: build-torch-wheels +# runs-on: ubuntu-24.04 +# name: merge metatomic-torch ${{ matrix.name }} +# strategy: +# matrix: +# include: +# - name: x86_64 Linux +# os: ubuntu-24.04 +# arch: x86_64 +# - name: arm64 Linux +# os: ubuntu-24.04-arm +# arch: arm64 +# - name: arm64 macOS +# os: macos-15 +# arch: arm64 +# - name: x86_64 Windows +# os: windows-2022 +# arch: x86_64 +# steps: +# - uses: actions/checkout@v6 + +# - name: Download wheels +# uses: actions/download-artifact@v8 +# with: +# pattern: torch-single-version-wheel-*-${{ matrix.os }}-${{ matrix.arch }} +# merge-multiple: false +# path: dist + +# - name: Set up Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.14" + +# - name: install dependencies +# run: python -m pip install twine wheel + +# - name: merge wheels +# run: | +# # collect all torch versions used for the build +# REQUIRES_TORCH=$(find dist -name "*.whl" -exec unzip -p {} "metatomic_torch-*.dist-info/METADATA" \; | grep "Requires-Dist: torch") +# MERGED_TORCH_REQUIRE=$(python scripts/create-torch-versions-range.py "$REQUIRES_TORCH") + +# echo MERGED_TORCH_REQUIRE=$MERGED_TORCH_REQUIRE + +# # unpack all single torch versions wheels in the same directory +# mkdir dist/unpacked +# find dist -name "*.whl" -print -exec python -m wheel unpack --dest dist/unpacked/ {} ';' + +# sed -i "s/Requires-Dist: torch.*/$MERGED_TORCH_REQUIRE/" dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA + +# echo "\n\n METADATA = \n\n" +# cat dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA + +# # check the right metadata was added to the file. grep will exit with +# # code `1` if the line is not found, which will stop CI +# grep "$MERGED_TORCH_REQUIRE" dist/unpacked/metatomic_torch-*/metatomic_torch-*.dist-info/METADATA + +# # repack the directory as a new wheel +# mkdir wheelhouse +# python -m wheel pack --dest wheelhouse/ dist/unpacked/* + +# - name: check wheels with twine +# run: twine check wheelhouse/* + +# - uses: actions/upload-artifact@v7 +# with: +# name: torch-wheel-${{ matrix.os }}-${{ matrix.arch }} +# path: ./wheelhouse/*.whl + +# build-others: +# name: Build other wheels/sdists +# runs-on: ubuntu-24.04 +# env: +# METATOMIC_NO_LOCAL_DEPS: "1" +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: Set up Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.14" + +# - name: install dependencies +# run: python -m pip install wheel build twine + +# - name: build metatomic-torch sdist +# run: python -m build python/metatomic_torch --sdist --outdir=dist/ + +# - name: build metatomic sdist and wheel +# run: python -m build . --outdir=dist/ + +# - name: build metatomic_ase sdist and wheel +# run: python -m build python/metatomic_ase --outdir=dist/ + +# - name: build metatomic_torchsim sdist and wheel +# run: python -m build python/metatomic_torchsim --outdir=dist/ + +# - name: check sdist and wheels with twine +# run: twine check dist/*.tar.gz dist/*.whl + +# - name: create C++ tarballs +# run: | +# ./scripts/package-torch.sh dist/cxx/ + +# - uses: actions/upload-artifact@v7 +# with: +# name: others +# path: | +# dist/*.tar.gz +# dist/cxx/*.tar.gz +# dist/*.whl + +# merge-and-release: +# name: Merge and release wheels/sdists +# needs: [merge-torch-wheels, build-others] +# runs-on: ubuntu-24.04 +# permissions: +# contents: write +# pull-requests: write +# steps: +# - name: Download metatomic-torch wheels +# uses: actions/download-artifact@v8 +# with: +# path: wheels +# pattern: torch-wheel-* +# merge-multiple: true + +# - name: Download other wheels and sdists +# uses: actions/download-artifact@v8 +# with: +# path: wheels +# name: others + +# - name: Re-upload a single wheels artifact +# uses: actions/upload-artifact@v7 +# with: +# name: wheels +# path: | +# wheels/* +# wheels/cxx/* + +# - name: Comment with download link +# uses: PicoCentauri/comment-artifact@v1 +# if: github.event.pull_request.head.repo.fork == false +# with: +# name: wheels +# description: ⚙️ Download Python wheels for this pull-request (you can install these with pip) + +# - name: upload to GitHub release (metatomic) +# if: startsWith(github.ref, 'refs/tags/metatomic-v') +# uses: softprops/action-gh-release@v3 +# with: +# files: | +# wheels/metatomic-* +# prerelease: ${{ contains(github.ref, '-rc') }} +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: upload to GitHub release (metatomic-torch) +# if: startsWith(github.ref, 'refs/tags/metatomic-torch-v') +# uses: softprops/action-gh-release@v3 +# with: +# files: | +# wheels/cxx/metatomic-torch-cxx-*.tar.gz +# wheels/metatomic_torch-* +# prerelease: ${{ contains(github.ref, '-rc') }} +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: upload to GitHub release (metatomic-ase) +# if: startsWith(github.ref, 'refs/tags/metatomic-ase-v') +# uses: softprops/action-gh-release@v3 +# with: +# files: | +# wheels/metatomic_ase-* +# prerelease: ${{ contains(github.ref, '-rc') }} +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: upload to GitHub release (metatomic-torchsim) +# if: startsWith(github.ref, 'refs/tags/metatomic-torchsim-v') +# uses: softprops/action-gh-release@v3 +# with: +# files: | +# wheels/metatomic_torchsim-* +# prerelease: ${{ contains(github.ref, '-rc') }} +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# test-build-external: +# # This checks building the wheels with external libraries. This setup is +# # mainly used for the conda packages metatensor-*-python, which use the +# # libmetatensor-* conda packages to provide the native code. +# runs-on: ${{ matrix.os }} +# name: External libraries / ${{ matrix.os }} +# defaults: +# run: +# shell: bash +# strategy: +# matrix: +# include: +# - os: ubuntu-24.04 +# rust-target: x86_64-unknown-linux-gnu +# torch-version: "2.12" +# libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.12.0%2Bcpu.zip +# - os: macos-15 +# rust-target: aarch64-apple-darwin +# torch-version: "2.12" +# libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.12.0.zip +# - os: windows-2022 +# rust-target: x86_64-pc-windows-msvc +# torch-version: "2.12" +# libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.12.0%2Bcpu.zip +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: setup Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.14" + +# - name: setup environment +# run: | +# pip install build +# echo "CMAKE_PREFIX_PATH=${RUNNER_TEMP//\\//}/usr" >> "$GITHUB_ENV" + +# - name: setup libtorch +# run: | +# curl --output libtorch.zip ${{ matrix.libtorch-url }} +# unzip -q libtorch.zip -d $CMAKE_PREFIX_PATH/ +# mv $CMAKE_PREFIX_PATH/libtorch/* $CMAKE_PREFIX_PATH/ + +# - name: setup libmetatensor +# run: | +# curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.2.0/metatensor-core-cxx-0.2.0.tar.gz +# tar xf metatensor-core-cxx-0.2.0.tar.gz +# cmake -B build-metatensor -S metatensor-core-cxx-0.2.0 \ +# -DMETATENSOR_INSTALL_BOTH_STATIC_SHARED=OFF \ +# -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ +# -DCMAKE_BUILD_TYPE=Debug +# cmake --build build-metatensor --config Debug +# cmake --install build-metatensor --config Debug + +# - name: setup libmetatensor-torch +# run: | +# curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-torch-v0.9.0/metatensor-torch-cxx-0.9.0.tar.gz +# tar xf metatensor-torch-cxx-0.9.0.tar.gz +# cmake -B build-metatensor-torch -S metatensor-torch-cxx-0.9.0 \ +# -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ +# -DCMAKE_BUILD_TYPE=Debug +# cmake --build build-metatensor-torch --config Debug +# cmake --install build-metatensor-torch --config Debug + +# - name: build libmetatomic-torch +# run: | +# cmake -B build-metatomic-torch -S metatomic-torch \ +# -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \ +# -DCMAKE_BUILD_TYPE=Debug +# cmake --build build-metatomic-torch --config Debug +# cmake --install build-metatomic-torch --config Debug + +# - name: build metatomic-torch wheels +# run: | +# pip install build + +# python -m build python/metatomic_torch --wheel --outdir=dist/ +# unzip -l dist/metatomic_torch*.whl | grep "_external.py" +# env: +# METATOMIC_TORCH_PYTHON_USE_EXTERNAL_LIB: "ON" +# METATOMIC_TORCH_BUILD_WITH_TORCH_VERSION: ${{ matrix.torch-version }}.* +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 939d6636..772f5ac0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,78 +1,78 @@ -name: Documentation +# name: Documentation -on: - push: - branches: [main] - tags: ["*"] - pull_request: - # Check all PR +# on: +# push: +# branches: [main] +# tags: ["*"] +# pull_request: +# # Check all PR -concurrency: - group: docs-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +# concurrency: +# group: docs-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -permissions: - pull-requests: write +# permissions: +# pull-requests: write -jobs: - build-and-publish: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 +# jobs: +# build-and-publish: +# runs-on: ubuntu-24.04 +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 - - name: setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" +# - name: setup Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.14" - - name: install dependencies - run: | - python -m pip install tox - sudo apt install doxygen +# - name: install dependencies +# run: | +# python -m pip install tox +# sudo apt install doxygen - - name: build documentation - env: - # Use the CPU only version of torch when building/running the code - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - run: tox -e docs +# - name: build documentation +# env: +# # Use the CPU only version of torch when building/running the code +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu +# run: tox -e docs - - name: store documentation as github artifact to be downloaded by users - uses: actions/upload-artifact@v7 - with: - name: docs - path: docs/build/html/* - overwrite: true # only keep the latest version of the documentation +# - name: store documentation as github artifact to be downloaded by users +# uses: actions/upload-artifact@v7 +# with: +# name: docs +# path: docs/build/html/* +# overwrite: true # only keep the latest version of the documentation - - name: Comment with download link - uses: PicoCentauri/comment-artifact@v1 - if: github.event.pull_request.head.repo.fork == false - with: - name: docs - description: 📚 Download documentation for this pull-request +# - name: Comment with download link +# uses: PicoCentauri/comment-artifact@v1 +# if: github.event.pull_request.head.repo.fork == false +# with: +# name: docs +# description: 📚 Download documentation for this pull-request - - name: put documentation in the website - run: | - git clone https://github.com/metatensor/docs metatensor-docs - rm -rf metatensor-docs/.git - cd metatensor-docs/metatomic +# - name: put documentation in the website +# run: | +# git clone https://github.com/metatensor/docs metatensor-docs +# rm -rf metatensor-docs/.git +# cd metatensor-docs/metatomic - REF_KIND=$(echo $GITHUB_REF | cut -d / -f2) - if [[ "$REF_KIND" == "tags" ]]; then - TAG=${GITHUB_REF#refs/tags/} - mv ../../docs/build/html $TAG - else - rm -rf latest - mv ../../docs/build/html latest - fi +# REF_KIND=$(echo $GITHUB_REF | cut -d / -f2) +# if [[ "$REF_KIND" == "tags" ]]; then +# TAG=${GITHUB_REF#refs/tags/} +# mv ../../docs/build/html $TAG +# else +# rm -rf latest +# mv ../../docs/build/html latest +# fi - - name: deploy to metatensor-docs - if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v4 - with: - external_repository: metatensor/docs - deploy_key: ${{ secrets.METATOMIC_DOCS_SSH_KEY }} - publish_branch: main - publish_dir: ./metatensor-docs/ - force_orphan: true +# - name: deploy to metatensor-docs +# if: github.event_name == 'push' +# uses: peaceiris/actions-gh-pages@v4 +# with: +# external_repository: metatensor/docs +# deploy_key: ${{ secrets.METATOMIC_DOCS_SSH_KEY }} +# publish_branch: main +# publish_dir: ./metatensor-docs/ +# force_orphan: true diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index da3944fb..e3f7f443 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,96 +1,96 @@ -name: Python tests +# name: Python tests -on: - push: - branches: [main] - pull_request: - # Check all PR +# on: +# push: +# branches: [main] +# pull_request: +# # Check all PR -concurrency: - group: python-tests-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +# concurrency: +# group: python-tests-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -jobs: - python-tests: - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} / Python ${{ matrix.python-version }} / Torch ${{ matrix.torch-version }} - strategy: - matrix: - include: - - os: ubuntu-24.04 - python-version: "3.10" - torch-version: "2.3" - numpy-version-pin: "<2.0" - # Do not run docs-tests with python 3.10 since torch-sim-atomistic - # is not available for this version of python - tox-envs: lint,torch-tests - - os: ubuntu-24.04 - python-version: "3.10" - torch-version: "2.12" - # See above - tox-envs: lint,torch-tests - - os: ubuntu-24.04 - # TorchScript is no longer supported in Python 3.14 - # so we keep a test with 3.13 to make sure this doesn't break - python-version: "3.13" - torch-version: "2.12" - tox-envs: lint,torch-tests,docs-tests - - os: ubuntu-24.04 - python-version: "3.14" - torch-version: "2.12" - tox-envs: lint,torch-tests,docs-tests - - os: macos-15 - python-version: "3.14" - torch-version: "2.12" - tox-envs: lint,torch-tests,docs-tests - - os: windows-2022 - python-version: "3.14" - torch-version: "2.12" - tox-envs: lint,torch-tests,docs-tests - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 +# jobs: +# python-tests: +# runs-on: ${{ matrix.os }} +# name: ${{ matrix.os }} / Python ${{ matrix.python-version }} / Torch ${{ matrix.torch-version }} +# strategy: +# matrix: +# include: +# - os: ubuntu-24.04 +# python-version: "3.10" +# torch-version: "2.3" +# numpy-version-pin: "<2.0" +# # Do not run docs-tests with python 3.10 since torch-sim-atomistic +# # is not available for this version of python +# tox-envs: lint,torch-tests +# - os: ubuntu-24.04 +# python-version: "3.10" +# torch-version: "2.12" +# # See above +# tox-envs: lint,torch-tests +# - os: ubuntu-24.04 +# # TorchScript is no longer supported in Python 3.14 +# # so we keep a test with 3.13 to make sure this doesn't break +# python-version: "3.13" +# torch-version: "2.12" +# tox-envs: lint,torch-tests,docs-tests +# - os: ubuntu-24.04 +# python-version: "3.14" +# torch-version: "2.12" +# tox-envs: lint,torch-tests,docs-tests +# - os: macos-15 +# python-version: "3.14" +# torch-version: "2.12" +# tox-envs: lint,torch-tests,docs-tests +# - os: windows-2022 +# python-version: "3.14" +# torch-version: "2.12" +# tox-envs: lint,torch-tests,docs-tests +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 - - name: setup Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} +# - name: setup Python +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python-version }} - - name: setup rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable +# - name: setup rust +# uses: dtolnay/rust-toolchain@master +# with: +# toolchain: stable - - name: Cache Rust dependencies - uses: Leafwing-Studios/cargo-cache@v2.6.1 - with: - sweep-cache: true +# - name: Cache Rust dependencies +# uses: Leafwing-Studios/cargo-cache@v2.6.1 +# with: +# sweep-cache: true - - name: Setup sccache - if: ${{ !env.ACT }} - uses: mozilla-actions/sccache-action@v0.0.10 - with: - version: "v0.10.0" +# - name: Setup sccache +# if: ${{ !env.ACT }} +# uses: mozilla-actions/sccache-action@v0.0.10 +# with: +# version: "v0.10.0" - - name: setup MSVC command prompt - uses: ilammy/msvc-dev-cmd@v1 +# - name: setup MSVC command prompt +# uses: ilammy/msvc-dev-cmd@v1 - - name: Setup sccache environnement variables - if: ${{ !env.ACT }} - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV +# - name: Setup sccache environnement variables +# if: ${{ !env.ACT }} +# run: | +# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV +# echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV +# echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV +# echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - - name: install tests dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox coverage +# - name: install tests dependencies +# run: | +# python -m pip install --upgrade pip +# python -m pip install tox coverage - - name: run tests - run: tox -e ${{ matrix.tox-envs }} - env: - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }} +# - name: run tests +# run: tox -e ${{ matrix.tox-envs }} +# env: +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu +# METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }} diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 9a29bf23..0cf2e291 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -25,31 +25,31 @@ jobs: strategy: matrix: include: - - os: ubuntu-24.04 - rust-version: stable - rust-target: x86_64-unknown-linux-gnu - cxx: g++ - cc: gcc - cmake-generator: Unix Makefiles - - # check the build on a stock Ubuntu 22.04, which uses cmake 3.22, and - # with our minimal supported rust version - - os: ubuntu-24.04 - rust-version: 1.74 - container: ubuntu:22.04 - rust-target: x86_64-unknown-linux-gnu - extra-name: ", cmake 3.22" - cxx: g++ - cc: gcc - cmake-generator: Unix Makefiles - - - os: macos-15 - rust-version: stable - rust-target: aarch64-apple-darwin - extra-name: "" - cxx: clang++ - cc: clang - cmake-generator: Unix Makefiles + # - os: ubuntu-24.04 + # rust-version: stable + # rust-target: x86_64-unknown-linux-gnu + # cxx: g++ + # cc: gcc + # cmake-generator: Unix Makefiles + + # # check the build on a stock Ubuntu 22.04, which uses cmake 3.22, and + # # with our minimal supported rust version + # - os: ubuntu-24.04 + # rust-version: 1.74 + # container: ubuntu:22.04 + # rust-target: x86_64-unknown-linux-gnu + # extra-name: ", cmake 3.22" + # cxx: g++ + # cc: gcc + # cmake-generator: Unix Makefiles + + # - os: macos-15 + # rust-version: stable + # rust-target: aarch64-apple-darwin + # extra-name: "" + # cxx: clang++ + # cc: clang + # cmake-generator: Unix Makefiles - os: windows-2022 rust-version: stable @@ -59,13 +59,13 @@ jobs: cc: cl.exe cmake-generator: Visual Studio 17 2022 - - os: windows-2022 - rust-version: stable - rust-target: x86_64-pc-windows-gnu - extra-name: " / MinGW" - cxx: g++.exe - cc: gcc.exe - cmake-generator: MinGW Makefiles + # - os: windows-2022 + # rust-version: stable + # rust-target: x86_64-pc-windows-gnu + # extra-name: " / MinGW" + # cxx: g++.exe + # cc: gcc.exe + # cmake-generator: MinGW Makefiles steps: - name: install dependencies in container if: matrix.container == 'ubuntu:22.04' @@ -88,6 +88,10 @@ jobs: toolchain: ${{ matrix.rust-version }} target: ${{ matrix.rust-target }} + - name: Setup MSVC developer command prompt + if: matrix.rust-target == 'x86_64-pc-windows-msvc' + uses: ilammy/msvc-dev-cmd@v1 + - name: setup Python uses: actions/setup-python@v6 if: matrix.container == null diff --git a/.github/workflows/torch-tests.yml b/.github/workflows/torch-tests.yml index b088f750..b875e1e9 100644 --- a/.github/workflows/torch-tests.yml +++ b/.github/workflows/torch-tests.yml @@ -1,107 +1,104 @@ -name: TorchScript tests - -on: - push: - branches: [main] - pull_request: - # Check all PR - -concurrency: - group: torch-tests-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - tests: - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} / Torch ${{ matrix.torch-version }}${{ matrix.extra-name }} - container: ${{ matrix.container }} - strategy: - matrix: - include: - - os: ubuntu-24.04 - torch-version: "2.12" - # Python 3.14.5 fails with "No module named pip.__main__; 'pip' is a - # package and cannot be directly executed" when using a venv, so we - # use 3.14.4 for now - python-version: "3.14.4" - cargo-test-flags: --release - do-valgrind: true - - # check the build on a stock Ubuntu 22.04, which uses cmake 3.22 - - os: ubuntu-24.04 - container: ubuntu:22.04 - extra-name: ", cmake 3.22" - torch-version: "2.3" - cargo-test-flags: "" - - - os: macos-15 - torch-version: "2.12" - python-version: "3.14.4" - cargo-test-flags: --release - - - os: windows-2022 - torch-version: "2.12" - python-version: "3.14.4" - cargo-test-flags: --release - steps: - - name: install dependencies in container - if: matrix.container == 'ubuntu:22.04' - run: | - apt update - apt install -y software-properties-common - add-apt-repository ppa:deadsnakes/ppa - apt install -y cmake make gcc g++ git curl python3.10 python3.10-venv - - update-alternatives --install /usr/local/bin/python python /usr/bin/python3.10 1 - - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: setup Python - uses: actions/setup-python@v6 - if: matrix.container == null - with: - python-version: ${{ matrix.python-version }} - - - name: Configure git safe directory - if: matrix.container == 'ubuntu:22.04' - run: git config --global --add safe.directory /__w/metatomic/metatomic - - - name: setup rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - - name: Cache Rust dependencies - uses: Leafwing-Studios/cargo-cache@v2.6.1 - with: - sweep-cache: true - - - name: install valgrind - if: matrix.do-valgrind - run: | - sudo apt-get install -y valgrind - - - name: Setup sccache - if: ${{ !env.ACT }} - uses: mozilla-actions/sccache-action@v0.0.10 - with: - version: "v0.10.0" - - - name: Setup sccache environnement variables - if: ${{ !env.ACT }} - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - - - name: run TorchScript C++ tests - run: cargo test --package metatomic-torch ${{ matrix.cargo-test-flags }} - env: - # Use the CPU only version of torch when building/running the code - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }} - CXXFLAGS: ${{ matrix.cxx-flags }} - RUST_BACKTRACE: full +# name: TorchScript tests + +# on: +# push: +# branches: [main] +# pull_request: +# # Check all PR + +# concurrency: +# group: torch-tests-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +# jobs: +# tests: +# runs-on: ${{ matrix.os }} +# name: ${{ matrix.os }} / Torch ${{ matrix.torch-version }}${{ matrix.extra-name }} +# container: ${{ matrix.container }} +# strategy: +# matrix: +# include: +# - os: ubuntu-24.04 +# torch-version: "2.12" +# python-version: "3.14.4" +# cargo-test-flags: --release +# do-valgrind: true + +# # check the build on a stock Ubuntu 22.04, which uses cmake 3.22 +# - os: ubuntu-24.04 +# container: ubuntu:22.04 +# extra-name: ", cmake 3.22" +# torch-version: "2.3" +# cargo-test-flags: "" + +# - os: macos-15 +# torch-version: "2.12" +# python-version: "3.14.4" +# cargo-test-flags: --release + +# - os: windows-2022 +# torch-version: "2.12" +# python-version: "3.14.4" +# cargo-test-flags: --release +# steps: +# - name: install dependencies in container +# if: matrix.container == 'ubuntu:22.04' +# run: | +# apt update +# apt install -y software-properties-common +# add-apt-repository ppa:deadsnakes/ppa +# apt install -y cmake make gcc g++ git curl python3.10 python3.10-venv + +# update-alternatives --install /usr/local/bin/python python /usr/bin/python3.10 1 + +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: setup Python +# uses: actions/setup-python@v6 +# if: matrix.container == null +# with: +# python-version: ${{ matrix.python-version }} + +# - name: Configure git safe directory +# if: matrix.container == 'ubuntu:22.04' +# run: git config --global --add safe.directory /__w/metatomic/metatomic + +# - name: setup rust +# uses: dtolnay/rust-toolchain@master +# with: +# toolchain: stable + +# - name: Cache Rust dependencies +# uses: Leafwing-Studios/cargo-cache@v2.6.1 +# with: +# sweep-cache: true + +# - name: install valgrind +# if: matrix.do-valgrind +# run: | +# sudo apt-get install -y valgrind + +# - name: Setup sccache +# if: ${{ !env.ACT }} +# uses: mozilla-actions/sccache-action@v0.0.10 +# with: +# version: "v0.10.0" + +# - name: Setup sccache environnement variables +# if: ${{ !env.ACT }} +# run: | +# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV +# echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV +# echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV +# echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV + +# - name: run TorchScript C++ tests +# run: cargo test --package metatomic-torch ${{ matrix.cargo-test-flags }} +# env: +# # Use the CPU only version of torch when building/running the code +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu +# METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }} +# CXXFLAGS: ${{ matrix.cxx-flags }} +# RUST_BACKTRACE: full diff --git a/.github/workflows/torchsim-tests.yml b/.github/workflows/torchsim-tests.yml index b20fc524..a4f5f220 100644 --- a/.github/workflows/torchsim-tests.yml +++ b/.github/workflows/torchsim-tests.yml @@ -1,60 +1,60 @@ -name: TorchSim integration - -on: - push: - branches: [main] - pull_request: - # Check all PR - -concurrency: - group: torchsim-tests-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - tests: - runs-on: ubuntu-24.04 - name: tests - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.13" - - - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.10 - with: - version: "v0.10.0" - - - name: Setup sccache environnement variables - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV - - - name: install tests dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox coverage - - - name: run tests - run: tox -e torchsim-tests - env: - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - - - name: combine Python coverage files - shell: bash - run: | - coverage combine .tox/*/.coverage - coverage xml - - - name: upload to codecov.io - uses: codecov/codecov-action@v6 - with: - fail_ci_if_error: true - files: coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} +# name: TorchSim integration + +# on: +# push: +# branches: [main] +# pull_request: +# # Check all PR + +# concurrency: +# group: torchsim-tests-${{ github.ref }} +# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +# jobs: +# tests: +# runs-on: ubuntu-24.04 +# name: tests +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: setup Python +# uses: actions/setup-python@v6 +# with: +# python-version: "3.13" + +# - name: Setup sccache +# uses: mozilla-actions/sccache-action@v0.0.10 +# with: +# version: "v0.10.0" + +# - name: Setup sccache environnement variables +# run: | +# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV +# echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV +# echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV +# echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV + +# - name: install tests dependencies +# run: | +# python -m pip install --upgrade pip +# python -m pip install tox coverage + +# - name: run tests +# run: tox -e torchsim-tests +# env: +# PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu + +# - name: combine Python coverage files +# shell: bash +# run: | +# coverage combine .tox/*/.coverage +# coverage xml + +# - name: upload to codecov.io +# uses: codecov/codecov-action@v6 +# with: +# fail_ci_if_error: true +# files: coverage.xml +# token: ${{ secrets.CODECOV_TOKEN }} From 3080cd713a6cf6eff28901a5665a3f404dc42f00 Mon Sep 17 00:00:00 2001 From: Johannes Spies <13813209+johannes-spies@users.noreply.github.com> Date: Fri, 29 May 2026 12:56:42 +0200 Subject: [PATCH 3/3] CI: remove Git usr/bin from PATH to fix Windows link.exe shadowing Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rust-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 0cf2e291..64991b4b 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -92,6 +92,13 @@ jobs: if: matrix.rust-target == 'x86_64-pc-windows-msvc' uses: ilammy/msvc-dev-cmd@v1 + - name: Remove Git usr/bin from PATH (link.exe shadows MSVC link.exe) + if: matrix.rust-target == 'x86_64-pc-windows-msvc' + shell: pwsh + run: | + $filtered = $env:PATH -split ';' | Where-Object { $_ -notlike '*Git\usr\bin*' } + echo "PATH=$($filtered -join ';')" >> $env:GITHUB_ENV + - name: setup Python uses: actions/setup-python@v6 if: matrix.container == null