Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 0 additions & 107 deletions .github/workflows/build.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/cibuildwheel_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.cibuildwheel]
skip = "cp36-*" # scikit-build-core requires >=3.7
build-verbosity = 3

[tool.cibuildwheel.linux]
before-all = [
"yum remove -y cmake",
]

# musllinux builds on an Alpinx Linux image, no need to mess with cmake there
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = ""
91 changes: 91 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build and Publish

# NOTE: build logic is duplicated here and in test_build.yml

# Run on the main branch for commits only
on:
push:
branches:
- master

jobs:
build_wheels:

# only run if the most recent commit contains '[ci publish]'
if: "contains(github.event.head_commit.message, '[ci publish]')"

strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

name: Build wheels ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Package source distribution
if: runner.os == 'Linux'
run: |
python -m pip install build
python -m build --sdist

- name: Run cibuildwheel
uses: pypa/cibuildwheel@v2.21
with:
config-file: ".github/workflows/cibuildwheel_config.toml"

- name: Copy source distribution into wheelhouse
if: runner.os == 'Linux'
run: mv dist/*.tar.gz wheelhouse/

# Upload binaries to the github artifact store
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
overwrite: true

# Push the resulting binaries to pypi on a tag starting with 'v'
upload_pypi:
name: Upload release to PyPI

# only run if the most recent commit contains '[ci publish]'
if: "contains(github.event.head_commit.message, '[ci publish]')"

needs: [build_wheels]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/potpourri3d
permissions: # we authenticate via PyPI's 'trusted publisher' workflow, this permission is required
id-token: write
steps:
- name: Download built wheels artifact # downloads from the jobs storage from the previous step
uses: actions/download-artifact@v4.1.7
with:
# omitting the `name: ` field downloads all artifacts from this workflow
path: dist

- name: List downloaded files from artifact
run: ls dist | cat # piping through cat prints one per line

# dist directory has subdirs from the different jobs, merge them into one directory and delete
# the empty leftover dirs
- name: Flatten directory
run: find dist -mindepth 2 -type f -exec mv -t dist {} + && find dist -type d -empty -delete

- name: List downloaded files from artifact after flatten
run: ls dist | cat # piping through cat prints one per line

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# To test: repository_url: https://test.pypi.org/legacy/

53 changes: 53 additions & 0 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test Build

# NOTE: build logic is duplicated here and in publish.yml

# Run on the master branch commit push and PRs to master (note conditional below)
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build_wheels:

# Only run if the commit message contains '[ci build]'
if: "contains(toJSON(github.event.commits.*.message), '[ci build]') || contains(toJSON(github.event.pull_request.title), '[ci build]')"

strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

name: Build wheels ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Package source distribution
if: runner.os == 'Linux'
run: |
python -m pip install build
python -m build --sdist

- name: Run cibuildwheel
uses: pypa/cibuildwheel@v2.21
with:
config-file: ".github/workflows/cibuildwheel_config.toml"

# Upload binaries to the github artifact store
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
overwrite: true
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[project]
name = "potpourri3d"
version = "1.2.0"
description = "An invigorating blend of 3D geometry tools in Python."
readme = "README.md"
license.file = "LICENSE"
authors = [
{ name = "Nicholas Sharp", email = "nmwsharp@gmail.com" },
]
maintainers = [
{ name = "Nicholas Sharp", email = "nmwsharp@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.7"

dependencies = [
"numpy",
"scipy"
]

[project.urls]
Homepage = "https://github.com/nmwsharp/potpourri3d"

[build-system]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
build.verbose = true
logging.level = "INFO"