-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* re-org CI workflows: adds support for Py3.12 & linux wheels, separates testing & pypi publishing * bump version & add python 3.12 to pyproject.toml * rename test-base to test_base * remove old Travis build script & doc reference
- Loading branch information
Showing
8 changed files
with
156 additions
and
73 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,86 @@ | ||
name: Python CI | ||
name: Build wheels | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * 0' # weekly | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
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 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
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 | ||
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 | ||
python-version: 3.11 | ||
|
||
# ======================= BUILD WHEELS AND UPLOAD TO PYPI ================================== | ||
- name: Install cibuildwheel | ||
run: | | ||
pip install --upgrade pip | ||
pip install cibuildwheel==2.15.0 | ||
- 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' | ||
- name: Build wheels | ||
env: | ||
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*' | ||
PYPI_PASSWORD: ${{ secrets.pypi_password }} | ||
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-* cp312-*' | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
run: | | ||
pip install cibuildwheel twine --upgrade; | ||
python -m build --sdist | ||
pip install cibuildwheel --upgrade; | ||
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' | ||
- name: Store artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/*.whl | ||
|
||
package_source: | ||
name: Package source distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install build | ||
run: python -m pip install build | ||
|
||
- name: Run sdist | ||
run: python -m build --sdist | ||
|
||
- name: Store artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: ./dist/*.tar.gz | ||
|
||
publish_to_pypi: | ||
needs: | ||
- build_wheels | ||
- package_source | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download build files | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Upload to PyPI | ||
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; | ||
pip install twine; | ||
python -m twine upload dist/* -u tommyod -p "$PYPI_PASSWORD" --skip-existing; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build docs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install packages | ||
run: | | ||
pip install pip --upgrade | ||
pip install --no-cache-dir -e .[dev] | ||
- name: Build docs | ||
run: | | ||
sudo apt install pandoc -y | ||
sphinx-build docs/source _build/html -W |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build & test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Python ${{ matrix.python-version }} / ${{ matrix.os }} | ||
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', '3.12'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install | ||
run: | | ||
pip install pip --upgrade | ||
pip install -e .[dev,test,lint] | ||
- name: Run tests and linting | ||
run: | | ||
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 | ||
pytest KDEpy --doctest-modules --capture=sys |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Build & test (develop) | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
test: | ||
uses: tommyod/KDEpy/.github/workflows/test_base.yml@develop |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Build & test (master) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
uses: tommyod/KDEpy/.github/workflows/test_base.yml@master |
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
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
This file was deleted.
Oops, something went wrong.