Skip to content

Commit

Permalink
Fix failing builds with CIBuildWheel (#159)
Browse files Browse the repository at this point in the history
* Use build instead of sdist

* Replace deprecated install command

* Update actions to newest runners

* Update package install in GH action

* Try new workflow, rename workflows

* Remove old CD job, add x86 builds for windows

* Add dependabot for github actions

* Add pypi push only on tags with 'v' on master

* Add macos wheels

* Bump version number, changelog
  • Loading branch information
catanzaromj authored Mar 2, 2024
1 parent 24c2f51 commit 35e7baf
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 172 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Set update schedule for GitHub Actions

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
58 changes: 58 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_SKIP: "pp* cp36-* cp37-* *win_arm64 *_i686 *musllinux*"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
name: Upload release to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ripser
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
73 changes: 0 additions & 73 deletions .github/workflows/python-publish.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Test project

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:
Expand All @@ -18,29 +18,29 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
python -m pip install --upgrade pip
pip install flake8 pytest-cov Cython
pip install -e ".[testing]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov ripser
- name: Upload coverage results
run: |
bash <(curl -s https://codecov.io/bash)
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
python -m pip install --upgrade pip
pip install flake8 pytest-cov Cython
pip install -e ".[testing]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov ripser
- name: Upload coverage results
run: |
bash <(curl -s https://codecov.io/bash)
test-conda:
runs-on: macos-latest
Expand All @@ -50,18 +50,18 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
- name: Set up conda
shell: bash -l {0}
run: |
run: |
conda install git numpy pandas scipy matplotlib pytest cython
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
python setup.py install
python -m pip install .
- name: Test with pytest
shell: bash -l {0}
run: |
Expand All @@ -75,19 +75,19 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
- name: Set up conda
shell: bash -l {0}
run: |
run: |
echo -e "[build]\ncompiler=msvc\n" >> setup.cfg
conda install git numpy pandas scipy matplotlib pytest libpython cython
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
python setup.py install
python -m pip install .
- name: Test with pytest
shell: bash -l {0}
run: |
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# 0.6.7
# 0.6.8

- Update CD commands for newer build system.

# 0.6.7

- Failed to build wheels. This version does not exist.

# 0.6.6

- Failed to build wheels. This version does not exist.

# 0.6.5

- Bugfix for lower star filtrations with edges that come in at exactly 0 (courtesy of Riccardo Ceccaroni)
Expand Down
2 changes: 1 addition & 1 deletion ripser/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.7"
__version__ = "0.6.8"
Loading

0 comments on commit 35e7baf

Please # to comment.