Skip to content

Commit f1afc45

Browse files
committed
ENH: create wheels with cibuildwheel
1 parent d29d56c commit f1afc45

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

.github/workflows/publish_pypi.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1+
name: Build and publish to PyPI
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
8+
build:
9+
name: Build wheels for all supported Python versions
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@master
14-
- name: Set up Python 3.10
15-
uses: actions/setup-python@v3
16-
with:
17-
python-version: "3.10"
13+
- uses: actions/checkout@v3
1814

19-
- name: Install pypa/build
20-
run: python -m pip install build --user
15+
- name: Set up Python (for pip/cibuildwheel)
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.10"
2119

22-
- name: Build a binary wheel and a source tarball
23-
run:
24-
python -m build --wheel --sdist --outdir dist/
20+
- name: Install cibuildwheel
21+
run: python -m pip install cibuildwheel
2522

26-
- name: Publish distribution 📦 to PyPI
27-
if: startsWith(github.ref, 'refs/tags')
28-
uses: pypa/gh-action-pypi-publish@release/v1
29-
with:
30-
password: ${{ secrets.PYPI_API_TOKEN }}
23+
- name: Build wheels with cibuildwheel
24+
run: python -m cibuildwheel --output-dir dist
25+
env:
26+
CIBW_SKIP: "pp* cp27* cp36*"
27+
28+
- name: Publish to PyPI
29+
if: startsWith(github.ref, 'refs/tags')
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[build-system]
22
requires = [
3-
"setuptools",
4-
"setuptools_scm>=6.2",
5-
"wheel",
6-
"cython",
7-
"oldest-supported-numpy",
8-
"numpy>=2.0.0rc1"
3+
"setuptools",
4+
"setuptools_scm>=6.2",
5+
"wheel",
6+
"cython",
7+
"oldest-supported-numpy",
8+
"numpy>=2.0.0rc1"
99
]
10-
10+
backend = "setuptools.build_meta"
1111

1212
[tool.black]
1313
line-length = 88
@@ -41,4 +41,3 @@ select = [
4141
# Pyupgrade
4242
"UP",
4343
]
44-

0 commit comments

Comments
 (0)