Skip to content

Commit 5c09ea9

Browse files
nmwsharpbdpedigo
andauthored
bump dependencies, overhaul build action (#21)
* move from setup.py to pyproject.toml * clean and modernize github actions * update dependencies to latest [ci build] * rename build action * dont use system python on macos action [ci build] * add scipy for tests [ci build] * minor * wait to bump for now [ci build] Co-authored-by: Ben Pedigo <[email protected]>
1 parent dd58b70 commit 5c09ea9

10 files changed

+180
-228
lines changed

.github/workflows/build.yml

-109
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tool.cibuildwheel]
2+
skip = "cp36-*" # scikit-build-core requires >=3.7
3+
build-verbosity = 3
4+
5+
[tool.cibuildwheel.linux]
6+
before-all = [
7+
"yum remove -y cmake",
8+
]

.github/workflows/publish.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Publish
2+
3+
# NOTE: build logic is duplicated here and in test_build.yml
4+
5+
# Run on the main branch for commits only
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build_wheels:
13+
14+
# only run if the most recent commit contains '[ci publish]'
15+
if: "contains(github.event.head_commit.message, '[ci publish]')"
16+
17+
strategy:
18+
matrix:
19+
# macos-13 is an intel runner, macos-14 is apple silicon
20+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
21+
22+
name: Build wheels ${{ matrix.os }}
23+
runs-on: ${{ matrix.os }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
submodules: 'recursive'
29+
30+
- name: Package source distribution
31+
if: runner.os == 'Linux'
32+
run: |
33+
python -m pip install build
34+
python -m build --sdist
35+
36+
- name: Run cibuildwheel
37+
uses: pypa/[email protected]
38+
with:
39+
config-file: ".github/workflows/cibuildwheel_config.toml"
40+
41+
# Upload binaries to the github artifact store
42+
- name: Upload wheels
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: cibw-wheels-${{ matrix.os }}
46+
path: |
47+
./wheelhouse/*.whl
48+
./wheelhouse/*.tar.gz
49+
overwrite: true
50+
51+
# Push the resulting binaries to pypi on a tag starting with 'v'
52+
upload_pypi:
53+
name: Upload release to PyPI
54+
55+
# only run if the most recent commit contains '[ci publish]'
56+
if: "contains(github.event.head_commit.message, '[ci publish]')"
57+
58+
needs: [build_wheels]
59+
runs-on: ubuntu-latest
60+
environment:
61+
name: pypi
62+
url: https://pypi.org/p/robust-laplacian/
63+
permissions: # we authenticate via PyPI's 'trusted publisher' workflow, this permission is required
64+
id-token: write
65+
steps:
66+
- name: Download built wheels artifact # downloads from the jobs storage from the previous step
67+
uses: actions/[email protected]
68+
with:
69+
# omitting the `name: ` field downloads all artifacts from this workflow
70+
path: dist
71+
72+
- name: List downloaded files from artifact
73+
run: ls dist | cat # piping through cat prints one per line
74+
75+
- name: Publish package to PyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
# with:
78+
# To test: repository_url: https://test.pypi.org/legacy/
79+

.github/workflows/test_build.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test Build
2+
3+
# NOTE: build logic is duplicated here and in publish.yml
4+
5+
# Run on the master branch commit push and PRs to master (note conditional below)
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
branches:
12+
- master
13+
14+
jobs:
15+
build_wheels:
16+
17+
# Only run if the commit message contains '[ci build]'
18+
if: "contains(toJSON(github.event.commits.*.message), '[ci build]') || contains(toJSON(github.event.pull_request.title), '[ci build]')"
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
# macos-13 is an intel runner, macos-14 is apple silicon
24+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
25+
26+
name: Build wheels ${{ matrix.os }}
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
submodules: 'recursive'
33+
34+
- name: Package source distribution
35+
if: runner.os == 'Linux'
36+
run: |
37+
python -m pip install build
38+
python -m build --sdist
39+
40+
- name: Run cibuildwheel
41+
uses: pypa/[email protected]
42+
with:
43+
config-file: ".github/workflows/cibuildwheel_config.toml"
44+
45+
# Upload binaries to the github artifact store
46+
- name: Upload wheels
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: cibw-wheels-${{ matrix.os }}
50+
path: |
51+
./wheelhouse/*.whl
52+
./wheelhouse/*.tar.gz
53+
overwrite: true

.github/workflows/test_linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-python@v2
1919
name: Install Python
2020
with:
21-
python-version: '3.7'
21+
python-version: '3.9'
2222

2323
- name: install python packages
2424
run: python3 -m pip install numpy scipy

.github/workflows/test_macos.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ jobs:
1515
with:
1616
submodules: 'recursive'
1717

18-
# Use system python on mac; 3.9 seems to be available and this way there aren't multiple versions floating around
19-
#- uses: actions/setup-python@v2
20-
#name: Install Python
21-
#with:
22-
#python-version: '3.7'
18+
- uses: actions/setup-python@v2
19+
name: Install Python
20+
with:
21+
python-version: '3.9'
2322

2423
- name: install python packages
2524
run: python3 -m pip install numpy scipy

deps/geometry-central

Submodule geometry-central updated 177 files

deps/pybind11

Submodule pybind11 updated 193 files

pyproject.toml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[project]
2+
name = "robust_laplacian"
3+
version = "0.2.8"
4+
description = "Robust Laplace matrices for meshes and point clouds"
5+
readme = "README.md"
6+
license.file = "LICENSE"
7+
authors = [
8+
{ name = "Nicholas Sharp", email = "[email protected]" },
9+
]
10+
maintainers = [
11+
{ name = "Nicholas Sharp", email = "[email protected]" },
12+
]
13+
classifiers = [
14+
"Development Status :: 5 - Production/Stable",
15+
"License :: OSI Approved :: MIT License",
16+
"Programming Language :: Python :: 3",
17+
]
18+
requires-python = ">=3.7"
19+
20+
dependencies = [
21+
"numpy",
22+
]
23+
24+
[project.urls]
25+
Homepage = "https://github.com/nmwsharp/robust-laplacians-py"
26+
27+
[build-system]
28+
requires = ["scikit-build-core"]
29+
build-backend = "scikit_build_core.build"
30+
31+
[tool.scikit-build]
32+
build.verbose = true
33+
logging.level = "INFO"

0 commit comments

Comments
 (0)