Skip to content

Build wheels

Build wheels #389

Workflow file for this run

name: Python CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Allow one of the matrix builds to fail without failing others
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
# The job
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
# The steps in the job. Each step either RUNS code, or USES an action
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Run tests and linting
run: |
pip install pip --upgrade
pip install --no-cache-dir -e .[dev,test,lint]
python -m black KDEpy -l 120 --check
python -m flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503,E231 --max-line-length=120 --exclude="*examples.py,testing.py,*kde.py" KDEpy
python -m pytest KDEpy --doctest-modules --capture=sys
- name: Build docs
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
continue-on-error: true
run: |
sudo apt install pandoc -y
sphinx-build docs/source _build/html -W
# ======================= BUILD WHEELS AND UPLOAD TO PYPI ==================================
- name: Build wheels (non-windows) ${{ matrix.python-version }} on ${{ matrix.os }}
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.10' && matrix.os != 'windows-latest'
env:
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
PYPI_PASSWORD: ${{ secrets.pypi_password }}
run: |
pip install cibuildwheel twine --upgrade;
python -m build --sdist
python -m cibuildwheel --output-dir dist;
python -m twine upload dist/* -u tommyod -p "$PYPI_PASSWORD" --skip-existing;
- name: Build wheels (windows) ${{ matrix.python-version }} on ${{ matrix.os }}
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.10' && matrix.os == 'windows-latest'
env:
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
PYPI_PASSWORD: ${{ secrets.pypi_password }}
run: |
pip install cibuildwheel twine --upgrade;
python -m cibuildwheel --output-dir dist;
python -m twine upload dist/* -u tommyod -p "${env:PYPI_PASSWORD}" --skip-existing;