-
Notifications
You must be signed in to change notification settings - Fork 23
Modernize build system to use pyproject.toml and build wheels #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4aa4ef0
greenlet 3.0.0 drops support for python 3.6
mayantaylor d928ba0
draft pyproject.toml
mayantaylor 02137a0
adding templated build wheel yaml
mayantaylor 6691369
Merge branch 'maya/version-updates' of https://github.com/UIUC-PPL/ch…
mayantaylor caf3095
set up build wheel action
mayantaylor 8e568e8
set up testpypi upload action
mayantaylor b348996
don't need cmake? not used
mayantaylor 24a546c
cleanup
mayantaylor 1e39a5b
adding pypy builds
mayantaylor 1c9fc93
Merge remote-tracking branch 'origin/main' into maya/modernize-build
mayantaylor 71e3c6a
work around pypy dev0 checkout
mayantaylor 519f49f
adding comments
mayantaylor 3e95006
updating installation instructions
mayantaylor acdaaa8
action to publish to pypi
mayantaylor 0a86514
tmp commit to get action to flush
mayantaylor ac5e394
tmp commit to get action to flush on PR
mayantaylor 12ed471
restoring upload action
mayantaylor c15d8d2
adding source dist
mayantaylor 3650c7b
fetch full depth
mayantaylor b24c6ce
adding source dist to upload
mayantaylor 9b102c5
line break
ritvikrao d45528e
experiment without github charm token
mayantaylor 9494b2a
cleanup - somehow checkout charm_src got duplicated
mayantaylor 9e6cf3f
remove manual requirements installation instructions (handled by pip …
mayantaylor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,64 @@ | ||
name: Build wheels | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch full history, necessary for git describe in setup.py | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, macos-13, macos-14] | ||
|
||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
if: runner.os == 'macOS' && runner.arch == 'ARM64' | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch full history, necessary for git describe in setup.py | ||
|
||
- name: Checkout charm_src # is this best practice? should we use a submodule? | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: charmplusplus/charm | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
path: charm_src/charm | ||
fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py | ||
|
||
- name: Checkout charm_src # is this best practice? should we use a submodule? | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: charmplusplus/charm | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
path: charm_src/charm | ||
fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py | ||
|
||
- name: Build wheels | ||
env: | ||
CIBW_SKIP: "*-manylinux_i686 *-manylinux_ppc64le *-manylinux_s390x *musllinux_*" | ||
uses: pypa/cibuildwheel@v2.20.0 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl |
This file contains hidden or 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,39 @@ | ||
name: Publish wheels to pypi | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
workflow_id: | ||
description: "The workflow ID to pull wheels from" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
publish: | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/charm4py | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
# download all the wheels | ||
path: unmerged | ||
run_id: ${{ github.event.inputs.workflow_id }} | ||
workflow: build_wheels.yml | ||
|
||
- name: Merge files to dist | ||
run: | | ||
mkdir dist | ||
mv unmerged/*/*.whl dist | ||
mv unmerged/*/*.tar.gz dist | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains hidden or 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,41 @@ | ||
name: Publish wheels to testpypi | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
workflow_id: | ||
description: "The workflow ID to pull wheels from" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
publish_test: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/charm4py | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
# download all the wheels | ||
path: unmerged | ||
run_id: ${{ github.event.inputs.workflow_id }} | ||
workflow: build_wheels.yml | ||
|
||
- name: Merge files to dist | ||
run: | | ||
mkdir dist | ||
mv unmerged/*/*.whl dist | ||
mv unmerged/*/*.tar.gz dist | ||
|
||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains hidden or 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 hidden or 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,44 @@ | ||
[build-system] | ||
requires = ["setuptools>=43.0.0", "cython>=3.0.0", "numpy>=1.10.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
description = 'Charm4py Parallel Programming Framework' | ||
authors = [ | ||
{ name = "Juan Galvez", email = "jjgalvez@illinois.edu" }, | ||
{ name = "Maya Taylor", email = "mayat4@illinois.edu" }, | ||
] | ||
maintainers = [{ name = "Maya Taylor", email = "mayat4@illinois.edu" }] | ||
name = "charm4py" | ||
dynamic = ["version"] | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
keywords = [ | ||
"parallel", | ||
"parallel programming", | ||
"distributed computing", | ||
"distributed", | ||
"hpc", | ||
"HPC", | ||
"runtime", | ||
] | ||
requires-python = ">=3.7" | ||
dependencies = ["numpy>=1.10.0", "greenlet>=3.0.0"] | ||
classifiers = [ | ||
'Intended Audience :: Developers', | ||
'License :: Free for non-commercial use', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: POSIX', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: Microsoft :: Windows', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Topic :: System :: Distributed Computing', | ||
'Topic :: System :: Clustering', | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://charm4py.readthedocs.io" | ||
Repository = "https://github.com/charmplusplus/charm4py" | ||
|
||
[project.scripts] | ||
charmrun = 'charmrun.start:start' |
This file contains hidden or 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,6 +1,3 @@ | ||
cython>=3.0.0 | ||
numpy | ||
numpy>=1.10.0 | ||
greenlet>=3.0.0 | ||
|
||
# Required for the charm++ build: | ||
cmake | ||
cython>=3.0.0 | ||
ritvikrao marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the token here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we don't, I removed it