Add ruff formatting #484
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
env: | |
# Only support 64-bit CPython > 3.6 | |
CIBW_SKIP: "cp36-* pp* *-manylinux_i686 *-musllinux_* *-win32 cp313-*" | |
# This has some of the software we need pre-installed on it | |
CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_wheel_builder | |
# Need to do some setup before repairing the wheel on linux... | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash .github/scripts/repair_command_linux.sh | |
# Specify eigen location for windows, and force it to use python in the path... | |
CIBW_ENVIRONMENT_WINDOWS: > | |
EXTRA_CMAKE_ARGS="-DEIGEN3_DIR=C:\\PROGRA~2\\Eigen3\\share\\eigen3\\cmake\\;-Dstempy_ENABLE_HDF5=OFF" | |
USE_PYTHON_IN_PATH=1 | |
# Get cmake to use python in the path... | |
CIBW_ENVIRONMENT_MACOS: > | |
EXTRA_CMAKE_ARGS="-DHDF5_DIR=/usr/local/HDF_Group/HDF5/current/cmake" | |
USE_PYTHON_IN_PATH=1 | |
CIBW_BEFORE_TEST: pip install -r {project}/tests/requirements.txt | |
CIBW_TEST_COMMAND: pytest {project}/tests | |
CIBW_ARCHS_MACOS: x86_64 arm64 | |
CIBW_BEFORE_ALL_MACOS: . .github/scripts/install_hdf5_macos.sh | |
# Use bash by default for the run command | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-latest, windows-2019] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Grab the whole history so that setuptools-scm can see the tags and | |
# give it a correct version even on non-tag push. | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: . .github/scripts/install.sh | |
- name: Build wheels | |
run: cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: build_wheels | |
name: Upload wheels to PyPI | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag push | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_api_token }} |