generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#16: bindings: Try pip build and PyPI publish from CI
- Loading branch information
1 parent
7f5337c
commit abef303
Showing
7 changed files
with
154 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Pip | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build with Pip | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [windows-latest, macos-latest, ubuntu-latest] | ||
python-version: ["3.8", "3.9"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set min macOS version | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV | ||
- name: Build and install | ||
run: | ||
# python -m pip install pytest | ||
pip install --verbose . | ||
|
||
# - name: Test | ||
# run: python -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Wheels | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
|
||
build_wheels: | ||
name: Wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
# Cross-compile on macOS | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
|
||
# Temporary: use pre-release Python 3.12 for stable ABI builds | ||
CIBW_PRERELEASE_PYTHONS: True | ||
|
||
- name: Verify clean directory | ||
run: git diff --exit-code | ||
shell: bash | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
|
||
upload_all: | ||
name: Upload to PyPI | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/vt-tv | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- uses: actions/setup-python@v4 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .vttv import tv_from_json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "nanobind>=1.3.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "vt-tv" | ||
version = "0.0.1" | ||
description = "vt-tv test" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
authors = [ | ||
{ name = "Jonathan Lifflander"}, | ||
{ name = "Pierre Pebay"} | ||
] | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/DARMA-tasking/vt-tv" | ||
|
||
|
||
[tool.cibuildwheel] | ||
# Necessary to see build output from the actual compilation | ||
build-verbosity = 1 | ||
|
||
# # Run pytest to ensure that the package was correctly built | ||
# test-command = "pytest {project}/tests" | ||
# test-requires = "pytest" | ||
|
||
# Needed for full C++17 support | ||
[tool.cibuildwheel.macos.environment] | ||
MACOSX_DEPLOYMENT_TARGET = "10.14" |