Skip to content

Commit f98403b

Browse files
committed
test Mac building
1 parent 4d84c9c commit f98403b

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed

.github/workflows/wheels.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,69 @@
1-
name: Build
1+
name: Build and upload to PyPI
22

3-
# on: [push, pull_request]
43
on:
54
push:
65
paths-ignore:
76
- .gitignore
87
- README.md
98
- LICENSE
109
- doc/
10+
release:
11+
types:
12+
- published
1113

1214
jobs:
1315
build_wheels:
1416
name: Build wheels on ${{ matrix.os }}
1517
runs-on: ${{ matrix.os }}
1618
strategy:
19+
# macos-13 is an intel runner, macos-14 is apple silicon
1720
matrix:
18-
os: [ubuntu-latest, windows-latest]
21+
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
1922

2023
steps:
2124
- uses: actions/checkout@v4
2225

23-
- uses: pypa/[email protected]
26+
- name: Build wheels
27+
uses: pypa/[email protected]
28+
env:
29+
CIBW_BUILD_VERBOSITY: 1
2430

2531
- uses: actions/upload-artifact@v4
2632
with:
2733
name: rehline-wheels-${{ matrix.os }}-${{ strategy.job-index }}
2834
path: ./wheelhouse/*.whl
35+
36+
build_sdist:
37+
name: Build source distribution
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Build sdist
43+
run: pipx run build --sdist
44+
45+
- uses: actions/upload-artifact@v4
46+
with:
47+
name: rehline-sdist
48+
path: dist/*.tar.gz
49+
50+
upload_pypi:
51+
needs: [build_wheels, build_sdist]
52+
runs-on: ubuntu-latest
53+
environment: pypi
54+
permissions:
55+
id-token: write
56+
if: github.event_name == 'release' && github.event.action == 'published'
57+
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
58+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
59+
steps:
60+
- uses: actions/download-artifact@v4
61+
with:
62+
# unpacks all regot artifacts into dist/
63+
pattern: rehline-*
64+
path: dist
65+
merge-multiple: true
66+
67+
- uses: pypa/gh-action-pypi-publish@release/v1
68+
# with:
69+
# To test: repository-url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ maintainers = [
1111
]
1212
license = {file = "LICENSE"}
1313
readme = "README.md"
14-
requires-python = ">=3.10"
14+
requires-python = ">= 3.10"
1515
dependencies = [
16-
"requests>=2.27.0",
17-
"pybind11>=2.11.1",
18-
"numpy>=1.23.5",
19-
"scipy>=1.11.4",
20-
"scikit-learn>=1.2.2"
16+
"numpy >= 1.23.5",
17+
"scipy >= 1.11.4",
18+
"scikit-learn >= 1.2.2"
2119
]
20+
2221
[pyproject.urls]
2322
homepage = "https://rehline.github.io/"
2423
repository = "https://github.com/softmin/ReHLine-python"
@@ -28,9 +27,9 @@ documentation = "https://rehline-python.readthedocs.io/en/latest/index.html"
2827
py-modules = ["build"]
2928

3029
[tool.cibuildwheel]
31-
# Only build on CPython 3.6
30+
# Only build on CPython
3231
build = "cp*"
3332

3433
[build-system]
35-
requires = ["requests ~= 2.27.0", "pybind11 ~= 2.11.1", "setuptools >= 69.0.3", "wheel >= 0.42.0"]
34+
requires = ["requests ~= 2.31.0", "pybind11 ~= 2.13.0", "setuptools >= 69.0.0", "wheel >= 0.42.0"]
3635
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ def __str__(self) -> str:
7676
# level" feature, but in the future it may provide more features.
7777
cmdclass={"build_ext": build_ext},
7878
zip_safe=False,
79-
python_requires=">=3.10",
79+
python_requires=">= 3.10",
8080
)

0 commit comments

Comments
 (0)