Skip to content

QCSchema v2

QCSchema v2 #85

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
sdist:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
create-args: >-
meson-python python-build
xtb
qcelemental
- run: |
export PKG_CONFIG_PATH="$CONDA_PREFIX/lib/pkgconfig:$CONDA_PREFIX/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
python -m build . --sdist --outdir . -n ${{ env.SETUP_ARGS }}
env:
SETUP_ARGS: >-
-Csetup-args=-Dxtb-6.7.1:la_backend=netlib
-Csetup-args=-Dmctc-lib:json=disabled
- uses: actions/upload-artifact@v7
with:
name: xtb-python-sdist
path: ./*.tar.gz
retention-days: 5
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
create-args: >-
python=${{ matrix.python }}
c-compiler fortran-compiler meson-python pytest
xtb
${{ (matrix.python == '3.14' || matrix.python == '3.13') && 'conda-forge/label/qcelemental_dev::qcelemental>=0.50.0rc3' || 'qcelemental' }}
- name: Setup build of extension module
run: |
pip3 install . ${{ env.SETUP_ARGS }}
env:
SETUP_ARGS: >-
--config-settings setup-args=-Dpkg_config_path=$CONDA_PREFIX/lib/pkgconfig
--config-settings setup-args=-Dxtb-6.7.1:la_backend=netlib
- name: Test Python package
run: pytest -v --pyargs xtb
env:
OMP_NUM_THREADS: 2,1
wheels:
needs:
- sdist
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python: ["38", "39", "310", "311", "312", "313", "314"]
include:
- os: ubuntu-latest
archs_linux: x86_64
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install "cibuildwheel>=3"
- name: Download sdist
uses: actions/download-artifact@v8
with:
name: xtb-python-sdist
- name: Build wheels
run: python -m cibuildwheel --output-dir . *.tar.gz
env:
CIBW_BUILD: "cp${{ matrix.python }}-*"
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS_LINUX: ${{ matrix.archs_linux || '' }}
CIBW_BEFORE_BUILD_LINUX: >
which python &&
python -V &&
echo "$PATH" &&
pkg-config --modversion xtb &&
pkg-config --cflags --libs xtb
# Linux setup inside the manylinux container
CIBW_BEFORE_ALL_LINUX: >
yum install -y pkgconfig &&
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest |
tar -xvj bin/micromamba &&
./bin/micromamba create -y -p /opt/conda-env
-c conda-forge
python
cffi
numpy
meson
ninja
pkg-config
xtb
# Pass host env vars through when needed
CIBW_ENVIRONMENT_PASS_LINUX: PKG_CONFIG_PATH
# Configure the build inside the Linux wheel container
CIBW_ENVIRONMENT_LINUX: >
PKG_CONFIG_PATH="/opt/conda-env/lib/pkgconfig:/opt/conda-env/share/pkgconfig"
XTBPATH="/opt/conda-env/share/xtb"
LD_LIBRARY_PATH="/opt/conda-env/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
PIP_CONFIG_SETTINGS="setup-args=-Dpkg_config_path=/opt/conda-env/lib/pkgconfig setup-args=-Dxtb-6.7.1:la_backend=netlib setup-args=-Dmctc-lib:json=disabled"
# If xtb links shared libraries that need bundling, keep auditwheel repair enabled.
# If the package ends up fully self-contained / static, the default repair is still fine.
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
- uses: actions/upload-artifact@v4
with:
name: xtb-python-${{ matrix.os }}-${{ matrix.python }}
path: ./*.whl
retention-days: 5
release:
needs:
- sdist
- wheels
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: ${{ github.workspace }} # This will download all files
- name: Create SHA256 checksums
run: |
set -ex
for output in xtb*/xtb*; do
pushd $(dirname "$output")
sha256sum $(basename "$output") | tee $(basename "$output").sha256
popd
done
- name: Copy release artifacts
run: |
mkdir dist/
cp -v xtb*/xtb*.whl xtb*/xtb*.tar.gz dist/
# - name: Publish to Test PyPI
# if: ${{ github.event_name == 'release' }}
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Upload assets
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'release' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: xtb*/xtb*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
# - name: Publish to PyPI
# if: ${{ github.event_name == 'release' }}
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}