-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e559913
commit 2f404d4
Showing
36 changed files
with
1,931 additions
and
33 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,61 @@ | ||
name: Build python wheels | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Get tags for use with git describe | ||
|
||
- name: Checkout pybind11 submodule | ||
run: git submodule update --init python/pybind11 | ||
|
||
- uses: fortran-lang/setup-fortran@main | ||
if: ${{ runner.os == 'macOS' }} | ||
with: | ||
compiler: gcc | ||
version: 8 | ||
|
||
# Copied from https://github.com/scipy/scipy/blob/main/.github/workflows/wheels.yml | ||
- name: win_amd64 - install rtools | ||
run: | | ||
# mingw-w64 | ||
choco install rtools -y --no-progress --force --version=4.0.0.20220206 | ||
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH | ||
if: ${{ runner.os == 'Windows' }} | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.5 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./prima_htmlcov | ||
|
||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz |
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
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,48 @@ | ||
[build-system] | ||
# scikit-build-core claims there's no need to explicitly specify Ninja, | ||
# as it will "automatically be downloaded if needed", but I don't know | ||
# how it determines "if needed", all I know is that we need it, particularly | ||
# for Windows. | ||
requires = ["scikit-build-core", "numpy", "ninja"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "prima" | ||
dependencies = ["numpy"] | ||
dynamic = ["version"] | ||
requires-python = ">= 3.7" # Driving factor is availavility of scikit-build-core | ||
|
||
[tool.scikit-build] | ||
cmake.args = ["-G Ninja", "-DBUILD_SHARED_LIBS=OFF", "-DPRIMA_ENABLE_PYTHON=ON"] | ||
cmake.verbose = true | ||
logging.level = "INFO" | ||
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" | ||
sdist.include = [".git-archival.txt"] | ||
install.components = ["Prima_Python_C_Extension"] | ||
|
||
[tool.setuptools_scm] # Section required | ||
write_to = "_version.txt" | ||
|
||
[tool.cibuildwheel] | ||
build-verbosity = 3 | ||
test-command = "coverage run --branch --source=prima,{project} -m pytest -s {project}/python/tests && coverage html -d {project}/prima_htmlcov" | ||
test-requires = ["pytest", "coverage", "packaging"] | ||
# We need scipy and pdfo (which depends on scipy) for compatibility tests. | ||
# scipy is not available on all platforms we support, so we try to install it | ||
# if posssible, otherwise we skip it. The test will skip itself if it cannot | ||
# import scipy. "--only-binary" ensure we do not try to build scipy from | ||
# source (which requires special setup we have no intention of doing). | ||
before-test = "pip install --only-binary :all: scipy pdfo || true" | ||
skip = [ | ||
# On windows we get a complaint from CMake: | ||
# "CMake Error at python/pybind11/tools/FindPythonLibsNew.cmake:191 (message): | ||
# Python config failure: Python is 32-bit, chosen compiler is 64-bit" | ||
# I do not see a way to install a 32-bit compiler with the setup-fortran action, | ||
# so we will just build 64-bit wheels on windows. | ||
"*-win32", | ||
# Disable building PyPy wheels on all platforms. If there is interest in supporting PyPy | ||
# we can look into it. | ||
"pp*", | ||
# Disable musllinux for the moment. It successfully built but there was an error when testing | ||
"*musllinux*", | ||
] |
Oops, something went wrong.