-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(python): port to nanobind, add actions for building package
- Loading branch information
1 parent
f15e4f5
commit 56e2848
Showing
18 changed files
with
482 additions
and
216 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
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,102 @@ | ||
name: Build Wheels | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
type: boolean | ||
required: true | ||
default: false | ||
description: 'Push the wheels to PyPI' | ||
release: | ||
types: [published] | ||
jobs: | ||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: '${{github.workspace}}/lang/python' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Build SDist | ||
run: | | ||
pipx run build --sdist | ||
- name: Check Metadata | ||
run: | | ||
pipx run twine check dist/* | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-sdist | ||
path: ${{github.workspace}}/lang/python/dist/*.tar.gz | ||
|
||
# Linux build fails because the compiler's not new enough | ||
# macOS build fails because it keeps trying to build a universal binary | ||
# | ||
# build_wheels: | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# os: [windows-latest, ubuntu-latest, macos-latest] | ||
# name: Build Wheels For ${{matrix.os}} | ||
# runs-on: ${{matrix.os}} | ||
# steps: | ||
# - name: Checkout Repository | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# submodules: true | ||
# | ||
# - name: Build Wheels | ||
# uses: pypa/[email protected] | ||
# with: | ||
# package-dir: '${{github.workspace}}/lang/python' | ||
# output-dir: '${{github.workspace}}/lang/python/wheelhouse' | ||
# | ||
# - name: Verify Clean Directory | ||
# shell: bash | ||
# run: | | ||
# git diff --exit-code | ||
# | ||
# - name: Upload Wheels | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# path: ${{github.workspace}}/lang/python/wheelhouse/*.whl | ||
# name: dist-${{matrix.os}} | ||
|
||
merge_wheels: | ||
name: Merge Wheels | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_sdist | ||
# - build_wheels | ||
steps: | ||
- name: Merge Artifacts | ||
uses: actions/upload-artifact/merge@v4 | ||
with: | ||
name: dist | ||
pattern: dist-* | ||
|
||
upload_release: | ||
name: Upload a Release | ||
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.release) | ||
needs: [merge_wheels] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: dist | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{secrets.PYPI_TOKEN}} |
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
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 |
---|---|---|
|
@@ -222,6 +222,37 @@ freely, subject to the following restrictions: | |
3. This notice may not be removed or altered from any source distribution. | ||
|
||
|
||
--------------- nanobind --------------- | ||
|
||
Copyright (c) 2022 Wenzel Jakob <[email protected]>. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
--------------- stb --------------- | ||
|
||
Copyright (c) 2017 Sean Barrett | ||
|
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# Build Files | ||
__pycache__/ | ||
dist/sourcepp/* | ||
!dist/sourcepp/__init__.py | ||
# Keep most Python-specific stuff in the root .gitignore | ||
# because scikit-build-core will use it to ignore everything | ||
# you want to ship!!!!!!!! This took like an hour to figure | ||
# out, thanks folks :D | ||
|
||
# Anyway | ||
|
||
wheelhouse/ |
Oops, something went wrong.