From 0a0686e1bd772e7af4e986086ef7b8526521fa7c Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 09:25:28 -0500 Subject: [PATCH 1/7] inter --- src/binder.cpp | 9 +++++++++ src/disp.cpp | 39 +++++++++++++++++++++++++++++++++++++++ src/disp.hpp | 6 ++++++ 3 files changed, 54 insertions(+) diff --git a/src/binder.cpp b/src/binder.cpp index 7bf7b26..efa6ef1 100644 --- a/src/binder.cpp +++ b/src/binder.cpp @@ -109,6 +109,15 @@ PYBIND11_MODULE(dispersion, m) { py::arg("pos"), py::arg("carts"), py::arg("C6s"), py::arg("C8s"), py::arg("C10s"), py::arg("RCs"), py::arg("params")); + m_d.def("disp_2B_XDM_inter", &disp::disp_2B_XDM_inter, R"pbdoc( + calculate intermolecular XDM dispersion energy using dimer-level C6s, C8s, + C10s, RCs matrices with monA/monB indices to restrict summation to + intermolecular atom pairs only. params = [a1, a2] + )pbdoc", + py::arg("pos"), py::arg("carts"), py::arg("C6s"), py::arg("C8s"), + py::arg("C10s"), py::arg("RCs"), py::arg("monAs"), py::arg("monBs"), + py::arg("params")); + m_d.def("disp_2B_dimer", &disp::disp_2B_dimer, R"pbdoc( calculate 2-body -D4 dispersion energy from positions, cartesians, C6s, and params for a dimer broken into two monomers with C6s and C8s diff --git a/src/disp.cpp b/src/disp.cpp index 6138542..3b613ef 100644 --- a/src/disp.cpp +++ b/src/disp.cpp @@ -167,6 +167,45 @@ double disp_2B_XDM_scaled(Ref pos, py::EigenDRef carts, return energy; }; +double disp_2B_XDM_inter(Ref pos, py::EigenDRef carts, + py::EigenDRef C6s, py::EigenDRef C8s, + py::EigenDRef C10s, py::EigenDRef RCs, + Ref monAs, Ref monBs, + Ref params) { + // Intermolecular XDM dispersion: only sum over pairs (i in monAs, j in monBs) + // Uses dimer-level C6s, C8s, C10s, RCs matrices indexed by dimer atom indices + // params[0] = a1, params[1] = a2 + double energy = 0; + double dis; + int A, B, i, j; + double a1, a2, de; + double ang_to_bohr = 1.8897261245650624; + a1 = params[0]; + a2 = params[1] * ang_to_bohr; +#pragma omp parallel for shared(C6s, C8s, C10s, RCs, carts, a1, a2, pos, monAs, \ + monBs) private(A, B, i, j, dis, de) \ + reduction(+ : energy) + for (A = 0; A < monAs.size(); A++) { + i = monAs[A]; + for (B = 0; B < monBs.size(); B++) { + j = monBs[B]; + double dx = carts(i, 0) - carts(j, 0); + double dy = carts(i, 1) - carts(j, 1); + double dz = carts(i, 2) - carts(j, 2); + double d2 = dx * dx + dy * dy + dz * dz; + double d6 = d2 * d2 * d2; + double d8 = d6 * d2; + double d10 = d8 * d2; + dis = a1 * RCs(i, j) + a2; + + de = -C6s(i, j) / (d6 + pow(dis, 6)) - C8s(i, j) / (d8 + pow(dis, 8)) - + C10s(i, j) / (d10 + pow(dis, 10)); + energy += de; + } + }; + return energy; +}; + double disp_2B_dimer(Ref pos, py::EigenDRef carts, py::EigenDRef C6s, Ref pA, py::EigenDRef cA, py::EigenDRef C6s_A, diff --git a/src/disp.hpp b/src/disp.hpp index 63c2569..1167e05 100644 --- a/src/disp.hpp +++ b/src/disp.hpp @@ -36,6 +36,12 @@ double disp_2B_XDM_scaled(Ref pos, py::EigenDRef carts, py::EigenDRef C10s, py::EigenDRef RCs, Ref params); +double disp_2B_XDM_inter(Ref pos, py::EigenDRef carts, + py::EigenDRef C6s, py::EigenDRef C8s, + py::EigenDRef C10s, py::EigenDRef RCs, + Ref monAs, Ref monBs, + Ref params); + double disp_2B_dimer(Ref pos, py::EigenDRef carts, py::EigenDRef C6s, Ref pA, py::EigenDRef cA, py::EigenDRef C6s_A, From f1d1572af95442bca8401acdd5c669236f25eb9f Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 09:37:04 -0500 Subject: [PATCH 2/7] CI updates --- .github/workflows/format.yml | 6 +++--- .github/workflows/pip.yml | 39 +++++++++++++++++++++++++++++------- .github/workflows/wheels.yml | 14 ++++++------- .gitmodules | 2 +- setup.py | 2 +- 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index c792242..687854b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -15,8 +15,8 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 5e8a046..a6a6bb2 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -12,25 +12,50 @@ jobs: strategy: fail-fast: false matrix: - platform: [windows-latest, macos-latest, ubuntu-latest] - python-version: ["3.8", "3.11"] + python-version: ["3.10", "3.12"] - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Add requirements + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + ninja-build \ + gfortran \ + libeigen3-dev \ + libopenblas-dev \ + liblapack-dev + + - name: Add Python requirements run: python -m pip install --upgrade wheel setuptools - - name: Build and install + - name: Build with CMake + run: | + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(nproc) + + - name: Install Python package run: pip install --verbose .[test] + - name: Add dftd4 binary to PATH + run: echo "${{ github.workspace }}/build/dftd4/app" >> $GITHUB_PATH + + - name: Verify dftd4 binary + run: | + which dftd4 + dftd4 --version || true + - name: Test run: python -m pytest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7299cb6..cc999ba 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,7 +15,7 @@ jobs: name: Build SDist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true @@ -25,7 +25,7 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz @@ -39,11 +39,11 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - - uses: pypa/cibuildwheel@v2.14 + - uses: pypa/cibuildwheel@v2.21 env: CIBW_ARCHS_MACOS: auto universal2 CIBW_PRERELEASE_PYTHONS: "1" @@ -53,7 +53,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: wheelhouse/*.whl @@ -65,11 +65,11 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: artifact path: dist diff --git a/.gitmodules b/.gitmodules index f207c3b..5645cc9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,4 +4,4 @@ branch = master [submodule "dftd4"] path = dftd4 - url = git@github.com:Awallace3/dftd4.git + url = https://github.com/Awallace3/dftd4.git diff --git a/setup.py b/setup.py index 56bd7fc..e231f8b 100644 --- a/setup.py +++ b/setup.py @@ -262,7 +262,7 @@ def run(self): }, zip_safe=False, extras_require={ - "test": ["pytest>=6.0"], + "test": ["pytest>=6.0", "numpy", "qcelemental"], }, python_requires=">=3.8", classifiers=[ From f0bcc7ea548118930125341c33e996267b31f79e Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 10:21:40 -0500 Subject: [PATCH 3/7] dropping conda and format --- .github/workflows/conda.yml | 48 ------------------------------------ .github/workflows/format.yml | 22 ----------------- 2 files changed, 70 deletions(-) delete mode 100644 .github/workflows/conda.yml delete mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml deleted file mode 100644 index 6e642b8..0000000 --- a/.github/workflows/conda.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Conda - -on: - workflow_dispatch: - push: - branches: - - master - pull_request: - -jobs: - build: - strategy: - fail-fast: false - matrix: - platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.8", "3.10"] - - runs-on: ${{ matrix.platform }} - - # The setup-miniconda action needs this to activate miniconda - defaults: - run: - shell: "bash -l {0}" - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: Get conda - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - python-version: ${{ matrix.python-version }} - channels: conda-forge - channel-priority: strict - - # Currently conda-build requires the dead package "toml" but doesn't declare it - - name: Prepare - run: conda install conda-build conda-verify pytest toml - - - name: Build - run: conda build conda.recipe - - - name: Install - run: conda install -c ${CONDA_PREFIX}/conda-bld/ cmake_example - - - name: Test - run: python -m pytest diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 687854b..0000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This is a format job. Pre-commit has a first-party GitHub action, so we use -# that: https://github.com/pre-commit/action - -name: Format - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - -jobs: - pre-commit: - name: Format - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - uses: pre-commit/action@v3.0.1 From 623439a28f077b05025f2bb3a2576736861363dd Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 10:33:26 -0500 Subject: [PATCH 4/7] pytest update --- dftd4 | 2 +- src/disp.cpp | 2 -- tests/test_basic.py | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dftd4 b/dftd4 index 8ced737..ac6aa3b 160000 --- a/dftd4 +++ b/dftd4 @@ -1 +1 @@ -Subproject commit 8ced73763a835934b5994309a261fe688bf26f4d +Subproject commit ac6aa3b18b8ca2c3b2860710c009a6b9803853a3 diff --git a/src/disp.cpp b/src/disp.cpp index 3b613ef..8f1b907 100644 --- a/src/disp.cpp +++ b/src/disp.cpp @@ -1351,7 +1351,6 @@ double disp_ATM_CHG_trimer_nambe(Ref pos, r3 = r2 * r1; r5 = r3 * r2; fdmp = 1.0 / (1.0 + 6.0 * pow(r0 / r1, alph / 3.0)); - printf("fdmp: %f\n", fdmp); ang = (0.375 * (dis_ij + dis_jk - dis_ik) * (dis_ij - dis_jk + dis_ik) * (-dis_ij + dis_jk + dis_ik) / r5 + 1.0 / r3); @@ -1425,7 +1424,6 @@ double disp_ATM_TT_trimer_nambe(Ref pos, (-dis_ij + dis_jk + dis_ik) / r5 + 1.0 / r3); fdmp = f6_ij * f6_ik * f6_jk; - printf("fdmp: %f\n", fdmp); energy -= 6 * (ang * fdmp * c9 * triple / 6.0); }; }; diff --git a/tests/test_basic.py b/tests/test_basic.py index f37854c..ba9b0b9 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -34,7 +34,7 @@ def test_disp_ATM_CHG_trimer_nambe(): } geom = np.hstack((data["symbols"].reshape(-1, 1), data["geometry"])) qcel_trimer = qcel.models.Molecule.from_data(geom, frags=data["frags"]) - print(qcel_trimer) + # print(qcel_trimer) C6s, C8s, C6s_ATM = pydispersion.qcel_mol_acquire_c6s(qcel_trimer) # Same parameters as Yi in # https://pubs.aip.org/aip/jcp/article/158/9/094110/2881313/Assessment-of-three-body-dispersion-models-against @@ -46,7 +46,7 @@ def test_disp_ATM_CHG_trimer_nambe(): "s9": 1.0, }, ) - print(f"nambe_ATM: {nambe_ATM}") + # print(f"nambe_ATM: {nambe_ATM}") return @@ -81,7 +81,7 @@ def test_disp_ATM_TT_trimer_nambe(): } geom = np.hstack((data["symbols"].reshape(-1, 1), data["geometry"])) qcel_trimer = qcel.models.Molecule.from_data(geom, frags=data["frags"]) - print(qcel_trimer) + # print(qcel_trimer) C6s, C8s, C6s_ATM = pydispersion.qcel_mol_acquire_c6s(qcel_trimer) # Same parameters as Yi in # https://pubs.aip.org/aip/jcp/article/158/9/094110/2881313/Assessment-of-three-body-dispersion-models-against @@ -93,7 +93,7 @@ def test_disp_ATM_TT_trimer_nambe(): "s9": 1.0, }, ) - print(f"nambe_ATM: {nambe_ATM}") + # print(f"nambe_ATM: {nambe_ATM}") return if __name__ == "__main__": From fe68bfc7649781b5be3b260cf40048207dd2a588 Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 12:20:26 -0500 Subject: [PATCH 5/7] updated to use environment.yml --- .github/workflows/pip.yml | 22 ++++++++++------------ .github/workflows/wheels.yml | 27 +++++++++++++++++++++++++++ environment.yml | 23 +++++++++++++++++++++++ 3 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 environment.yml diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index a6a6bb2..f9da1c2 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -21,25 +21,19 @@ jobs: with: submodules: true - - uses: actions/setup-python@v5 + - uses: conda-incubator/setup-miniconda@v3 with: + activate-environment: ci + auto-activate-base: false + environment-file: environment.yml python-version: ${{ matrix.python-version }} - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - cmake \ - ninja-build \ - gfortran \ - libeigen3-dev \ - libopenblas-dev \ - liblapack-dev - - name: Add Python requirements + shell: bash -el {0} run: python -m pip install --upgrade wheel setuptools - name: Build with CMake + shell: bash -el {0} run: | mkdir -p build cd build @@ -47,15 +41,19 @@ jobs: make -j$(nproc) - name: Install Python package + shell: bash -el {0} run: pip install --verbose .[test] - name: Add dftd4 binary to PATH + shell: bash -el {0} run: echo "${{ github.workspace }}/build/dftd4/app" >> $GITHUB_PATH - name: Verify dftd4 binary + shell: bash -el {0} run: | which dftd4 dftd4 --version || true - name: Test + shell: bash -el {0} run: python -m pytest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index cc999ba..552ebbe 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -47,6 +47,33 @@ jobs: env: CIBW_ARCHS_MACOS: auto universal2 CIBW_PRERELEASE_PYTHONS: "1" + CIBW_BEFORE_ALL_LINUX: >- + bash -lc "set -euxo pipefail && + python -c 'import urllib.request; urllib.request.urlretrieve(\"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\", \"/tmp/miniconda.sh\")' && + bash /tmp/miniconda.sh -b -p /opt/miniconda3 && + /opt/miniconda3/bin/conda env create -n cibw -f /project/environment.yml" + CIBW_BEFORE_ALL_MACOS: >- + bash -lc "set -euxo pipefail && + arch=$(uname -m) && + if [ \"$arch\" = \"arm64\" ]; then installer=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh; else installer=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; fi && + curl -fsSL -o /tmp/miniconda.sh \"$installer\" && + bash /tmp/miniconda.sh -b -p /Users/runner/miniconda3 && + /Users/runner/miniconda3/bin/conda env create -n cibw -f \"$GITHUB_WORKSPACE/environment.yml\"" + CIBW_BEFORE_ALL_WINDOWS: >- + powershell -NoProfile -ExecutionPolicy Bypass -Command + "Invoke-WebRequest -Uri 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe' -OutFile C:\\miniconda.exe; Start-Process -FilePath C:\\miniconda.exe -ArgumentList '/InstallationType=JustMe','/RegisterPython=0','/S','/D=C:\\Miniconda3' -Wait; C:\\Miniconda3\\Scripts\\conda.exe env create -n cibw -f \"$env:GITHUB_WORKSPACE\\environment.yml\"" + CIBW_ENVIRONMENT_LINUX: >- + PATH=/opt/miniconda3/envs/cibw/bin:/opt/miniconda3/bin:$PATH + CMAKE_PREFIX_PATH=/opt/miniconda3/envs/cibw + Eigen3_DIR=/opt/miniconda3/envs/cibw/share/eigen3/cmake + CIBW_ENVIRONMENT_MACOS: >- + PATH=/Users/runner/miniconda3/envs/cibw/bin:/Users/runner/miniconda3/bin:$PATH + CMAKE_PREFIX_PATH=/Users/runner/miniconda3/envs/cibw + Eigen3_DIR=/Users/runner/miniconda3/envs/cibw/share/eigen3/cmake + CIBW_ENVIRONMENT_WINDOWS: >- + PATH=C:\\Miniconda3\\envs\\cibw;C:\\Miniconda3\\envs\\cibw\\Library\\bin;C:\\Miniconda3\\Scripts;C:\\Miniconda3;%PATH% + CMAKE_PREFIX_PATH=C:\\Miniconda3\\envs\\cibw + Eigen3_DIR=C:\\Miniconda3\\envs\\cibw\\share\\eigen3\\cmake - name: Verify clean directory run: git diff --exit-code diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..ba82920 --- /dev/null +++ b/environment.yml @@ -0,0 +1,23 @@ +name: disp +channels: + - conda-forge + - nodefaults +dependencies: + # build + - c-compiler + - cmake + - cxx-compiler + - ninja + - eigen + - libblas=*=*mkl + - libboost-headers + - llvm-openmp + - numpy + - pip + - python + - fortran-compiler + - zlib + - setuptools + - pytest + - pytest-xdist + - qcelemental From da8f7936dea635cafbedce1d3e31579b49bbeed4 Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 13:03:41 -0500 Subject: [PATCH 6/7] wheel update --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 552ebbe..ba476a2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -49,7 +49,8 @@ jobs: CIBW_PRERELEASE_PYTHONS: "1" CIBW_BEFORE_ALL_LINUX: >- bash -lc "set -euxo pipefail && - python -c 'import urllib.request; urllib.request.urlretrieve(\"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\", \"/tmp/miniconda.sh\")' && + if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then yum install -y curl; fi && + if command -v curl >/dev/null 2>&1; then curl -fsSL -o /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; else wget -qO /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; fi && bash /tmp/miniconda.sh -b -p /opt/miniconda3 && /opt/miniconda3/bin/conda env create -n cibw -f /project/environment.yml" CIBW_BEFORE_ALL_MACOS: >- From 15097d4243eac26b5935e57cf0c72c2341e34f7e Mon Sep 17 00:00:00 2001 From: AMW Arch Date: Mon, 2 Mar 2026 13:14:45 -0500 Subject: [PATCH 7/7] dropped wheels --- .github/workflows/wheels.yml | 107 ----------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml deleted file mode 100644 index ba476a2..0000000 --- a/.github/workflows/wheels.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Wheels - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - release: - types: - - published - -jobs: - build_sdist: - name: Build SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Build SDist - run: pipx run build --sdist - - - name: Check metadata - run: pipx run twine check dist/* - - - uses: actions/upload-artifact@v4 - with: - path: dist/*.tar.gz - - - build_wheels: - name: Wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - uses: pypa/cibuildwheel@v2.21 - env: - CIBW_ARCHS_MACOS: auto universal2 - CIBW_PRERELEASE_PYTHONS: "1" - CIBW_BEFORE_ALL_LINUX: >- - bash -lc "set -euxo pipefail && - if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then yum install -y curl; fi && - if command -v curl >/dev/null 2>&1; then curl -fsSL -o /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; else wget -qO /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; fi && - bash /tmp/miniconda.sh -b -p /opt/miniconda3 && - /opt/miniconda3/bin/conda env create -n cibw -f /project/environment.yml" - CIBW_BEFORE_ALL_MACOS: >- - bash -lc "set -euxo pipefail && - arch=$(uname -m) && - if [ \"$arch\" = \"arm64\" ]; then installer=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh; else installer=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; fi && - curl -fsSL -o /tmp/miniconda.sh \"$installer\" && - bash /tmp/miniconda.sh -b -p /Users/runner/miniconda3 && - /Users/runner/miniconda3/bin/conda env create -n cibw -f \"$GITHUB_WORKSPACE/environment.yml\"" - CIBW_BEFORE_ALL_WINDOWS: >- - powershell -NoProfile -ExecutionPolicy Bypass -Command - "Invoke-WebRequest -Uri 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe' -OutFile C:\\miniconda.exe; Start-Process -FilePath C:\\miniconda.exe -ArgumentList '/InstallationType=JustMe','/RegisterPython=0','/S','/D=C:\\Miniconda3' -Wait; C:\\Miniconda3\\Scripts\\conda.exe env create -n cibw -f \"$env:GITHUB_WORKSPACE\\environment.yml\"" - CIBW_ENVIRONMENT_LINUX: >- - PATH=/opt/miniconda3/envs/cibw/bin:/opt/miniconda3/bin:$PATH - CMAKE_PREFIX_PATH=/opt/miniconda3/envs/cibw - Eigen3_DIR=/opt/miniconda3/envs/cibw/share/eigen3/cmake - CIBW_ENVIRONMENT_MACOS: >- - PATH=/Users/runner/miniconda3/envs/cibw/bin:/Users/runner/miniconda3/bin:$PATH - CMAKE_PREFIX_PATH=/Users/runner/miniconda3/envs/cibw - Eigen3_DIR=/Users/runner/miniconda3/envs/cibw/share/eigen3/cmake - CIBW_ENVIRONMENT_WINDOWS: >- - PATH=C:\\Miniconda3\\envs\\cibw;C:\\Miniconda3\\envs\\cibw\\Library\\bin;C:\\Miniconda3\\Scripts;C:\\Miniconda3;%PATH% - CMAKE_PREFIX_PATH=C:\\Miniconda3\\envs\\cibw - Eigen3_DIR=C:\\Miniconda3\\envs\\cibw\\share\\eigen3\\cmake - - - name: Verify clean directory - run: git diff --exit-code - shell: bash - - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - path: wheelhouse/*.whl - - - upload_all: - name: Upload if release - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - - steps: - - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - uses: actions/download-artifact@v4 - with: - name: artifact - path: dist - - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.pypi_password }}