cpow true #128
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: deploy-pypi | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install OpenMP and numpy for mac | |
if: runner.os == 'macos' | |
run: | | |
# This is needed to import numpy in pypy3 (but not needed for pypy2 and CPython) | |
brew install openblas | |
OPENBLAS="$(brew --prefix openblas)" | |
pip3 install numpy | |
# Test | |
- name: Install package and dependencies | |
if: runner.os != 'macos' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade numpy | |
- name: Install fortran compiler on mac | |
if: runner.os == 'macos' | |
run: brew reinstall gcc | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: "*-manylinux_x86_64 *-macosx_x86_64 *-win_amd64" | |
CIBW_SKIP: "pp3*-macosx* pp3*-win* pp37* cp36-* cp37-* cp38-* cp312-*" | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_BEFORE_BUILD_LINUX: python -m pip install --upgrade pip; python -m pip install --upgrade numpy | |
# CIBW_BEFORE_BUILD_WINDOWS: pip install --upgrade pip; pip install --upgrade numpy | |
with: | |
output-dir: wheelhouse | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
retention-days: 1 | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Build sdist | |
run: python setup.py sdist | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
retention-days: 1 | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
name: Publish to PyPi | |
# upload to PyPI on every tag starting with 'v' | |
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Upload to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
test_pypi: | |
needs: [upload_pypi] | |
name: Test on ${{ matrix.os }} and Pyhton ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.9', '3.10', '3.11'] | |
include: | |
- os: ubuntu-latest | |
python-version: 'pypy-3.8' | |
- os: ubuntu-latest | |
python-version: 'pypy-3.9' | |
- os: ubuntu-latest | |
python-version: 'pypy-3.10' | |
steps: | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install packages | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest-cov | |
python -m pip install special_functions | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Test | |
run: | | |
python -m pip install numpy | |
python -m pip install -r tests/requirements.txt | |
mv special_functions special_functions_do_dot_import | |
pytest |