Update to use scipy.integrate trapezoid and cumulative_trapezoid #12
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_with_cibuildwheel_and_upload_to_PyPI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- 'MCEq/**' | |
- '!MCEq/data/README.md' | |
tags: | |
- 'release**' | |
pull_request: | |
types: | |
- opened | |
paths: | |
- 'MCEq/**' | |
- '!MCEq/data/README.md' | |
jobs: | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build SDist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Wheel for ${{ matrix.py }} ${{ matrix.os }} ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
if: ${{ !(github.event_name == 'pull_request')}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
arch: [native, aarch64, universal2] | |
py: [cp36, cp37, cp38, cp39, cp310] | |
exclude: | |
- os: windows-latest | |
arch: aarch64 | |
- os: windows-latest | |
arch: universal2 | |
- os: macos-latest | |
arch: aarch64 | |
- os: macos-latest | |
arch: universal2 | |
py: cp36 | |
- os: macos-latest | |
arch: universal2 | |
py: cp37 | |
- os: ubuntu-latest | |
arch: universal2 | |
env: | |
PYTEST_COMMAND: pytest --pyargs MCEq | |
PYTEST_COMMAND_AARCH64: > | |
cd {package}/MCEq/tests && | |
pytest test_densities.py test_msis.py | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
if: ${{ matrix.arch == 'aarch64' }} | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up testing command for aarch64 | |
if: ${{ (matrix.arch == 'aarch64') && !(matrix.py == 'cp36') }} | |
run: | | |
echo "CIBW_TEST_COMMAND=${{ env.PYTEST_COMMAND_AARCH64 }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Set up testing command for other cases | |
if: ${{ !(matrix.arch == 'aarch64') }} | |
run: | | |
echo "CIBW_TEST_COMMAND=${{ env.PYTEST_COMMAND }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.5.0 | |
env: | |
CIBW_BUILD: ${{ matrix.py }}-* | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_SKIP: "*musllinux*" | |
CIBW_TEST_SKIP: "*-macosx_universal2:arm64" | |
CIBW_TEST_REQUIRES: pytest | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl | |
build_wheels_on_pr: | |
name: Wheel for ${{ matrix.py }} ${{ matrix.os }} ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.event_name == 'pull_request' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
arch: [native] | |
py: [cp39] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.5.0 | |
env: | |
CIBW_BUILD: ${{ matrix.py }}-* | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_SKIP: "*musllinux*" | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: pytest --pyargs MCEq | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl | |
upload_all_to_PyPI: | |
name: Upload to PyPI | |
needs: [build_wheels, make_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- name: Download files in artifact to "dist/" directory | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish the package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |