Skip to content

Commit 3715a11

Browse files
Updates for PyPI build
1 parent d017402 commit 3715a11

4 files changed

Lines changed: 145 additions & 7 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 102 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,113 @@ on:
55
release:
66
types: [published]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
9-
wheels:
10-
name: ${{ matrix.os }}
12+
build_wheels:
13+
name: wheels-${{ matrix.os }}
1114
runs-on: ${{ matrix.os }}
1215
strategy:
1316
fail-fast: false
1417
matrix:
15-
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
1620
steps:
1721
- uses: actions/checkout@v4
18-
- uses: pypa/cibuildwheel@v2.18
22+
23+
- name: Build wheels
24+
uses: pypa/cibuildwheel@v3.4.1
1925
env:
20-
CIBW_BUILD: "cp310-* cp311-* cp312-*"
21-
CIBW_TEST_REQUIRES: pytest
22-
CIBW_TEST_COMMAND: "python -c \"import bioimage_cpp\" && pytest {project}/tests"
26+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
27+
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
28+
CIBW_ARCHS_MACOS: "native"
29+
CIBW_TEST_REQUIRES: "pytest pooch scipy"
30+
CIBW_TEST_COMMAND: "python -c \"import bioimage_cpp; print(bioimage_cpp.__file__)\" && pytest -q {project}/tests"
31+
32+
- name: Upload wheels
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: cibw-wheels-${{ matrix.os }}
36+
path: wheelhouse/*.whl
37+
38+
build_sdist:
39+
name: sdist
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.11"
47+
48+
- name: Install build tooling
49+
run: python -m pip install build twine
50+
51+
- name: Build sdist
52+
run: python -m build --sdist
53+
54+
- name: Check sdist metadata
55+
run: python -m twine check dist/*
56+
57+
- name: Upload sdist
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: cibw-sdist
61+
path: dist/*.tar.gz
62+
63+
publish-testpypi:
64+
name: publish-to-testpypi
65+
needs: [build_wheels, build_sdist]
66+
runs-on: ubuntu-latest
67+
if: github.event_name == 'workflow_dispatch'
68+
69+
environment:
70+
name: testpypi
71+
url: https://test.pypi.org/p/bioimage-cpp
72+
73+
permissions:
74+
id-token: write
75+
76+
steps:
77+
- name: Download distributions
78+
uses: actions/download-artifact@v4
79+
with:
80+
pattern: cibw-*
81+
path: dist
82+
merge-multiple: true
83+
84+
- name: List distributions
85+
run: ls -lh dist
86+
87+
- name: Publish to TestPyPI
88+
uses: pypa/gh-action-pypi-publish@release/v1
89+
with:
90+
repository-url: https://test.pypi.org/legacy/
91+
92+
publish-pypi:
93+
name: publish-to-pypi
94+
needs: [build_wheels, build_sdist]
95+
runs-on: ubuntu-latest
96+
if: github.event_name == 'release' && github.event.action == 'published'
97+
98+
environment:
99+
name: pypi
100+
url: https://pypi.org/p/bioimage-cpp
101+
102+
permissions:
103+
id-token: write
104+
105+
steps:
106+
- name: Download distributions
107+
uses: actions/download-artifact@v4
108+
with:
109+
pattern: cibw-*
110+
path: dist
111+
merge-multiple: true
112+
113+
- name: List distributions
114+
run: ls -lh dist
115+
116+
- name: Publish to PyPI
117+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ venv/
3030
*.npz
3131

3232
CLAUDE.md
33+
pypi-release.txt

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 bioimage-cpp contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ authors = [
1616
classifiers = [
1717
"Development Status :: 3 - Alpha",
1818
"Intended Audience :: Science/Research",
19+
"License :: OSI Approved :: MIT License",
1920
"Programming Language :: C++",
2021
"Programming Language :: C++ :: 20",
2122
"Programming Language :: Python :: 3",
2223
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2329
"Topic :: Scientific/Engineering :: Image Processing",
2430
]
2531

32+
[project.urls]
33+
Homepage = "https://github.com/computational-cell-analytics/bioimage-cpp"
34+
Repository = "https://github.com/computational-cell-analytics/bioimage-cpp"
35+
Issues = "https://github.com/computational-cell-analytics/bioimage-cpp/issues"
36+
2637
[project.optional-dependencies]
2738
test = ["pytest", "pooch", "scipy"]
2839
data = ["pooch"]
@@ -31,6 +42,16 @@ data = ["pooch"]
3142
cmake.version = ">=3.21"
3243
cmake.build-type = "Release"
3344
wheel.packages = ["src/bioimage_cpp"]
45+
sdist.exclude = [
46+
"pypi-release.txt",
47+
"dist/",
48+
"wheelhouse/",
49+
"_skbuild/",
50+
"build/",
51+
"*.egg-info/",
52+
".pytest_cache/",
53+
"__pycache__/",
54+
]
3455

3556
[tool.pytest.ini_options]
3657
testpaths = ["tests"]

0 commit comments

Comments
 (0)