Skip to content

Commit 35e7baf

Browse files
authored
Fix failing builds with CIBuildWheel (#159)
* 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
1 parent 24c2f51 commit 35e7baf

File tree

7 files changed

+159
-172
lines changed

7 files changed

+159
-172
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
# Check for updates to GitHub Actions every week
9+
interval: "weekly"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest, macos-latest]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Build wheels
17+
uses: pypa/[email protected]
18+
env:
19+
CIBW_SKIP: "pp* cp36-* cp37-* *win_arm64 *_i686 *musllinux*"
20+
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
24+
path: ./wheelhouse/*.whl
25+
26+
build_sdist:
27+
name: Build source distribution
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Build sdist
33+
run: pipx run build --sdist
34+
35+
- uses: actions/upload-artifact@v4
36+
with:
37+
name: cibw-sdist
38+
path: dist/*.tar.gz
39+
40+
upload_pypi:
41+
name: Upload release to PyPI
42+
needs: [build_wheels, build_sdist]
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: pypi
46+
url: https://pypi.org/p/ripser
47+
permissions:
48+
id-token: write
49+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
# unpacks all CIBW artifacts into dist/
54+
pattern: cibw-*
55+
path: dist
56+
merge-multiple: true
57+
58+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/python-publish.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/python-app.yml renamed to .github/workflows/python-tests.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Test project
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [master]
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
jobs:
1313
test:
@@ -18,29 +18,29 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919

2020
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install dependencies
27-
run: |
28-
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
29-
python -m pip install --upgrade pip
30-
pip install flake8 pytest-cov Cython
31-
pip install -e ".[testing]"
32-
- name: Lint with flake8
33-
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with pytest
39-
run: |
40-
pytest --cov ripser
41-
- name: Upload coverage results
42-
run: |
43-
bash <(curl -s https://codecov.io/bash)
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
29+
python -m pip install --upgrade pip
30+
pip install flake8 pytest-cov Cython
31+
pip install -e ".[testing]"
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
- name: Test with pytest
39+
run: |
40+
pytest --cov ripser
41+
- name: Upload coverage results
42+
run: |
43+
bash <(curl -s https://codecov.io/bash)
4444
4545
test-conda:
4646
runs-on: macos-latest
@@ -50,18 +50,18 @@ jobs:
5050
python-version: ["3.9", "3.10", "3.11", "3.12"]
5151

5252
steps:
53-
- uses: actions/checkout@v2
54-
- uses: conda-incubator/setup-miniconda@v2
53+
- uses: actions/checkout@v4
54+
- uses: conda-incubator/setup-miniconda@v3
5555
with:
5656
auto-update-conda: true
5757
python-version: ${{ matrix.python-version }}
5858
activate-environment: test
5959
- name: Set up conda
6060
shell: bash -l {0}
61-
run: |
61+
run: |
6262
conda install git numpy pandas scipy matplotlib pytest cython
6363
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
64-
python setup.py install
64+
python -m pip install .
6565
- name: Test with pytest
6666
shell: bash -l {0}
6767
run: |
@@ -75,19 +75,19 @@ jobs:
7575
python-version: ["3.9", "3.10", "3.11", "3.12"]
7676

7777
steps:
78-
- uses: actions/checkout@v2
79-
- uses: conda-incubator/setup-miniconda@v2
78+
- uses: actions/checkout@v4
79+
- uses: conda-incubator/setup-miniconda@v3
8080
with:
8181
auto-update-conda: true
8282
python-version: ${{ matrix.python-version }}
8383
activate-environment: test
8484
- name: Set up conda
8585
shell: bash -l {0}
86-
run: |
86+
run: |
8787
echo -e "[build]\ncompiler=msvc\n" >> setup.cfg
8888
conda install git numpy pandas scipy matplotlib pytest libpython cython
8989
git clone https://github.com/martinus/robin-hood-hashing ripser/robinhood
90-
python setup.py install
90+
python -m pip install .
9191
- name: Test with pytest
9292
shell: bash -l {0}
9393
run: |

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# 0.6.7
1+
# 0.6.8
22

33
- Update CD commands for newer build system.
44

5+
# 0.6.7
6+
7+
- Failed to build wheels. This version does not exist.
8+
9+
# 0.6.6
10+
11+
- Failed to build wheels. This version does not exist.
12+
513
# 0.6.5
614

715
- Bugfix for lower star filtrations with edges that come in at exactly 0 (courtesy of Riccardo Ceccaroni)

ripser/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.7"
1+
__version__ = "0.6.8"

0 commit comments

Comments
 (0)