Skip to content

Commit

Permalink
test Mac building
Browse files Browse the repository at this point in the history
  • Loading branch information
yixuan committed Oct 30, 2024
1 parent 4d84c9c commit f98403b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
49 changes: 45 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,69 @@
name: Build
name: Build and upload to PyPI

# on: [push, pull_request]
on:
push:
paths-ignore:
- .gitignore
- README.md
- LICENSE
- doc/
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# macos-13 is an intel runner, macos-14 is apple silicon
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]

steps:
- uses: actions/checkout@v4

- uses: pypa/cibuildwheel@v2.16
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v4
with:
name: rehline-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: rehline-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all regot artifacts into dist/
pattern: rehline-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
# with:
# To test: repository-url: https://test.pypi.org/legacy/
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ maintainers = [
]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">= 3.10"
dependencies = [
"requests>=2.27.0",
"pybind11>=2.11.1",
"numpy>=1.23.5",
"scipy>=1.11.4",
"scikit-learn>=1.2.2"
"numpy >= 1.23.5",
"scipy >= 1.11.4",
"scikit-learn >= 1.2.2"
]

[pyproject.urls]
homepage = "https://rehline.github.io/"
repository = "https://github.com/softmin/ReHLine-python"
Expand All @@ -28,9 +27,9 @@ documentation = "https://rehline-python.readthedocs.io/en/latest/index.html"
py-modules = ["build"]

[tool.cibuildwheel]
# Only build on CPython 3.6
# Only build on CPython
build = "cp*"

[build-system]
requires = ["requests ~= 2.27.0", "pybind11 ~= 2.11.1", "setuptools >= 69.0.3", "wheel >= 0.42.0"]
requires = ["requests ~= 2.31.0", "pybind11 ~= 2.13.0", "setuptools >= 69.0.0", "wheel >= 0.42.0"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ def __str__(self) -> str:
# level" feature, but in the future it may provide more features.
cmdclass={"build_ext": build_ext},
zip_safe=False,
python_requires=">=3.10",
python_requires=">= 3.10",
)

0 comments on commit f98403b

Please sign in to comment.