-
Notifications
You must be signed in to change notification settings - Fork 14
Update the building wheels procedure to use cibuildwheels tool #425
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 all commits
Commits
Show all changes
146 commits
Select commit
Hold shift + click to select a range
9d5bac5
Add: first iteration of buildwheels.yml
Griger5 256b66a
Disable tests+pypi
Griger5 4a2c00c
Fix: fix whitespace
Griger5 e92f5f3
Add: submodule checkout
Griger5 31cef8f
Disable all other actions
Griger5 6f35c85
Disable all other actions
Griger5 789ab65
Add: Fortran compiler installation on windows platforms
Griger5 ebf51ad
Update: windows-latest build
Griger5 e8b5730
fix: windows build wheels
Griger5 5c49fd0
fix
Griger5 2b65787
fix
Griger5 c95be38
debug windows-latest only
Griger5 096642c
fix
Griger5 0ffda02
fortran fix
Griger5 55f406b
fortran fix
Griger5 1f0b205
fortran fix
Griger5 6226fa0
fortran fix
Griger5 e10403b
enable ubuntu-latest only
Griger5 f693b94
fix
Griger5 956ec81
fortran
Griger5 a2b577c
fortran
Griger5 beff4fb
fortran
Griger5 13a5bfc
sanity fix
Griger5 b4d892b
fortran fix
Griger5 192e62a
fortran fix
Griger5 bf80865
fortran fix
Griger5 9e92904
fortran fix
Griger5 2343dc1
fortran fix
Griger5 73d1f47
fortran fix
Griger5 ccb245a
fortran fix
Griger5 02080a0
fortran fix
Griger5 bb6934a
fortran fix
Griger5 cb3ded5
fortran fix
Griger5 f69b0df
skip 32 bit builds
Griger5 8ba4dbf
Delete python versions matrix, general clean up
Griger5 f04ce48
Skip PyPy builds
Griger5 af89287
Add: build wheels for all supported os
Griger5 9c55d8e
Fix: download gcc for macos builds
Griger5 8293c92
Fix: macos builds
Griger5 005f22a
Fix: macos builds
Griger5 25ddec5
Check all builds
Griger5 8e10d95
Skip musllinux builds
Griger5 4b48720
change artifact naming
Griger5 a742450
change artifact naming
Griger5 ae2b0f5
sanity check: change artifact naming
Griger5 15510c1
move windows' gfortran and ninja installation
Griger5 42795bb
move windows' gfortran and ninja installation
Griger5 64730ff
Attempt to add testing
Griger5 414ceae
Attempt to add testing
Griger5 54ac76a
Attempt to add testing
Griger5 0b18142
Attempt to fix macos testing
Griger5 eb2f7c9
Enable all other actions
Griger5 0cecacf
add: zenodo_json and debug_build
Griger5 89e552e
change the command for testing
Griger5 06494c2
fix path in the command for testing
Griger5 07aba87
add pytest-order as an requirement before testing
Griger5 8f70219
add: dist_check and dist_upload
Griger5 467838f
disable dist_check
Griger5 30f5401
check CIBW_BEFORE_ALL behaviour
Griger5 a2e1622
attempt to test the notebooks
Griger5 9d9d834
attempt to test the notebooks
Griger5 25da54e
fix typo
Griger5 e146f00
fix typo
Griger5 8e9ee14
attempt to test the notebooks
Griger5 0ef6803
attempt to add dist_check
Griger5 f64c3bc
attempt to add dist_check
Griger5 fa93aba
fix notebooks
Griger5 05e8ab3
fix notebooks
Griger5 ec795d1
fix notebooks
Griger5 e337fe9
try out dist_check
Griger5 d36466b
fix notebooks
Griger5 906bb19
fix notebooks
Griger5 880ca2a
fix typo
Griger5 c17beb2
attempt to fix notebook run
Griger5 6b3a88a
attempt to fix notebook run
Griger5 20c9c29
attempt to fix notebook run
Griger5 7087c3e
check with ls
Griger5 a8953fe
check with ls
Griger5 74f51fe
attempt to fix notebook run
Griger5 7d366ec
fix typo
Griger5 f5dd319
attempt to fix notebook run
Griger5 d129b47
attempt to fix notebook run
Griger5 f77e21e
attempt to fix notebook run
Griger5 4c3277c
attempt to fix notebook run
Griger5 8e93cf2
dumb-fix: added fixes were in the wrong place
Griger5 275c398
attempt to fix notebook run
Griger5 a5ecbfc
attempt to fix notebook run
Griger5 23f030c
attempt to fix notebook run
Griger5 62362ad
attempt to fix notebook run
Griger5 aaa5fa2
attempt to fix notebook run
Griger5 d2a871f
sanity check
Griger5 9f24221
sanity check
Griger5 684d9f7
replace direct wheel name
Griger5 4cf7bad
delete ls
Griger5 2878a80
every os now runs the notebooks once, test_todos_annotated are run once
Griger5 74a85da
disable separate run_notebooks job, add name to running todos
Griger5 fae0300
run all os again
Griger5 b273895
delete commented code, try escaping the square brackets
Griger5 929d356
attempt to fix windows build
Griger5 489a972
fix: add missing if
Griger5 e06b08f
try to fix the yml
Griger5 7cab715
try to fix the yml syntax
Griger5 1698890
try to fix the yml syntax
Griger5 13a93e7
use bash on windows
Griger5 03b7241
delete old .yml file, add some comments
Griger5 7c53127
rename the CI run
Griger5 2a8bef6
running example notebooks is now a separate job
Griger5 ff4a39b
fix indent
Griger5 5208b04
move checking annotated todos into a separate job
Griger5 e8ba61f
add macos-13 arm builds
Griger5 3c6452c
change spaces to _ in job name
Griger5 640722e
add missing 'needs' parameter for the example notebooks jon
Griger5 484aaee
fix missing dependencies
Griger5 a7eebb4
change uppercase to lower so it matches the rest of the file + check …
Griger5 7f9275b
sanity check: change macos-13-arm64 to macos-13-arm
Griger5 64eb4d8
add wheel repair for windows
Griger5 8c8672a
build arm64 wheels for macos on an Intel runner
Griger5 afa3730
delete macos-13-arm from os matrix
Griger5 f7c139e
build macos wheels for universal2
Griger5 2ac27d3
add flags for fortran on macos universal2 builds
Griger5 2fc520a
try to fix the flag
Griger5 ee701ef
try to fix the flag syntax
Griger5 70db19e
attempt to fix the flag syntax
Griger5 7b7caa7
add a comment + sanity check
Griger5 a5efb4b
attempt to fix universal2 builds
Griger5 8e2364d
try to add the cmake fortran flag again
Griger5 512a419
disable other oses for testing
Griger5 b844b8c
fix yaml syntax
Griger5 f8f770c
move setup-python
Griger5 4e407fa
attempt to fix the fortran flags syntax again
Griger5 92864fd
replace cmake_args with cmake_cache_args
Griger5 40181b7
try to enable cross-compilation for universal2 builds
Griger5 b300b1a
use full path in the FC variable
Griger5 0c4e84d
install lld on macos
Griger5 21557fd
add missing &&
Griger5 847df5c
delete sudo from the brew install command
Griger5 a961ea4
reinstall gcc before build
Griger5 992d052
add gfortran path to PATH
Griger5 cf26327
delete &&
Griger5 b5337c3
delete ARCHFLAGS
Griger5 98b256f
check gcc version
Griger5 321f1a6
try to uninstall gcc
Griger5 cc378d5
add missing &&
Griger5 7b39bc4
revert changes, get rid of universal2 builds for now
Griger5 7746ff7
enable all os for builds
Griger5 a5ac0a2
Merge branch 'main' into update-build-cibuildwheel
Griger5 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,168 @@ | ||
name: build_wheels+tests | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
debug_build_ok: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 | ||
- run: DEBUG=1 VERBOSE=1 pip install --verbose -e .[tests] | ||
- run: pytest -v -s -We -p no:unraisableexception tests | ||
|
||
zenodo_json: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: '.zenodo.json' | ||
prop_path: 'creators' | ||
|
||
build_wheels: | ||
needs: [debug_build_ok, zenodo_json] | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
# download C and Fortran compiler on windows | ||
- if: matrix.os == 'windows-latest' | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: false | ||
install: >- | ||
mingw-w64-x86_64-gcc-fortran | ||
mingw-w64-x86_64-ninja | ||
m4 | ||
|
||
- uses: actions/setup-python@v5 | ||
|
||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.23.2 | ||
|
||
- name: Build and test wheels | ||
env: | ||
# skip 32-bit, PyPy, and musllinux builds | ||
CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*" | ||
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel | ||
CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=D:/a/_temp/msys64/mingw64/bin/ninja.exe" CMAKE_PROGRAM_PATH="D:/a/_temp/msys64/usr/bin" CMAKE_GENERATOR="Ninja" TEMP="D:/a/_temp/" | ||
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel} | ||
CIBW_BEFORE_BUILD_MACOS: brew reinstall gcc | ||
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion` SYSTEM_VERSION_COMPAT=0 | ||
CIBW_TEST_REQUIRES: pytest pytest-order | ||
CIBW_TEST_COMMAND: pytest -v -s -We -p no:unraisableexception {package}/tests | ||
run: python -m cibuildwheel --output-dir dist | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-${{matrix.os}}-${{matrix.manylinux}} | ||
path: dist | ||
|
||
run_example_notebooks: | ||
needs: [build_wheels] | ||
runs-on: ${{ matrix.os }} | ||
name: Run example notebooks on ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
python-version: "3.13" | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{matrix.os}}-${{matrix.manylinux}} | ||
path: dist | ||
|
||
- run: | | ||
temp=`find dist/ -name "*cp313*.whl"` | ||
python -m pip install $temp[examples] | ||
ex -sc 'g/^PyPartMC/d' -cx .binder/requirements.txt | ||
python -m pip install --force-reinstall --no-deps $PIP_INSTALL_OPTS -r .binder/requirements.txt | ||
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt | ||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_run_notebooks.py | ||
|
||
check_annotated_todos: | ||
runs-on: ubuntu-latest | ||
name: Check if todos are annotated | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- run: | | ||
python -m pip install pytest | ||
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt | ||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_todos_annotated.py | ||
|
||
dist_check: | ||
runs-on: ${{ matrix.os }} | ||
needs: [build_wheels] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-24.04-arm] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
- run: pip install twine auditwheel | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{matrix.os}}-${{matrix.manylinux}} | ||
path: dist | ||
- run: twine check --strict dist/* | ||
- run: for i in dist/*-manylinux*.whl; do auditwheel show $i; done; | ||
|
||
dist_upload: | ||
runs-on: ubuntu-latest | ||
needs: [build_wheels] | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: dist-* | ||
merge-multiple: true | ||
path: dist | ||
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: pypa/gh-action-pypi-publish@release/v1.12 | ||
with: | ||
repository_url: https://test.pypi.org/legacy/ | ||
attestations: false | ||
- run: | | ||
echo "github.event_name:" ${{ github.event_name }} | ||
echo "github.event.action:" ${{ github.event.action }} | ||
echo "github.event.prerelease:" ${{ github.event.prerelease }} | ||
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF }} | ||
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF_NAME }} | ||
- if: github.event_name == 'release' && github.event.prerelease == false | ||
uses: pypa/gh-action-pypi-publish@release/v1.12 | ||
with: | ||
attestations: false |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.