forked from mitsuba-renderer/mitsuba3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating wheels. Use native arm64 Github runner and transfer CIBW env…
…vars to `pyproject.toml`
- Loading branch information
Showing
9 changed files
with
160 additions
and
115 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,37 +8,30 @@ on: | |
default: '0' | ||
|
||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_SKIP: "*-musllinux* pp*" | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_ARCHS_WINDOWS: auto64 | ||
CIBW_ARCHS_LINUX: auto64 | ||
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "python .github/workflows/tag_wheel_manylinux.py {wheel} {dest_dir}" | ||
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} --ignore-missing-dependencies {wheel}" | ||
CIBW_TEST_COMMAND: "python -c \"import mitsuba as mi; mi.set_variant(\\\"scalar_rgb\\\")\"" | ||
CIBW_TEST_SKIP: "*-macosx_arm64" | ||
MACOSX_DEPLOYMENT_TARGET: 10.14 | ||
CIBW_TEST_COMMAND: "python -c \"import mitsuba\"" | ||
CIBW_TEST_REQUIRES: "" | ||
|
||
jobs: | ||
build_wheels: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-latest, macos-latest] | ||
python: [cp38, cp39, cp310, cp311, cp312] | ||
cibw-arch: [x86_64, arm64] | ||
os: [ubuntu-20.04, windows-latest, macos-13, macos-14] | ||
python: [cp38, cp39, cp310, cp311, cp312, cp313, cp313_stable] | ||
exclude: | ||
- os: ubuntu-20.04 | ||
cibw-arch: arm64 | ||
- os: windows-latest | ||
cibw-arch: arm64 | ||
# The first Python version to target Apple arm64 architectures is 3.9 | ||
- os: macos-14 | ||
python: cp38 | ||
fail-fast: false | ||
|
||
name: > | ||
${{ matrix.python }} wheel for ${{ matrix.os }} | ||
${{ (matrix.os == 'macos-latest' && format('({0})', matrix.cibw-arch)) || '' }} | ||
${{ (endsWith(matrix.python, '_stable') && '(stable ABI)') || '' }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
########################################################### | ||
# Setup local environment (source code, build requirements) | ||
########################################################### | ||
- uses: Wandalen/[email protected] | ||
with: | ||
action: actions/checkout@v3 | ||
|
@@ -50,7 +43,7 @@ jobs: | |
- uses: actions/setup-python@v4 | ||
name: Install Python | ||
with: | ||
python-version: '3.8' | ||
python-version: '3.10' | ||
|
||
- name: Prepare compiler environment for Windows | ||
if: runner.os == 'Windows' | ||
|
@@ -60,34 +53,41 @@ jobs: | |
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install cibuildwheel==2.16.2 | ||
python -m pip install cibuildwheel==2.20.0 | ||
- name: Local build for macOS cross-compilation | ||
if: runner.os == 'macOS' && matrix.cibw-arch == 'arm64' | ||
################################################################ | ||
# Set up envvars to build the correct wheel (stable ABI or not) | ||
################################################################ | ||
- name: Prepare cibuildwheel environment (UNIX) | ||
if: ${{ ! endsWith(matrix.python, '_stable') && runner.os != 'Windows' }} | ||
run: | | ||
echo "CIBW_BUILD=${{ matrix.python }}-*" >> $GITHUB_ENV | ||
- name: Prepare cibuildwheel environment (Windows) | ||
if: ${{ ! endsWith(matrix.python, '_stable') && runner.os == 'Windows' }} | ||
run: | | ||
pip install ninja cmake | ||
mkdir build | ||
cmake -B build -GNinja . | ||
ninja -C build | ||
echo "CIBW_BUILD=${{ matrix.python }}-*" >> $env:GITHUB_ENV | ||
- name: Prepare cibuildwheel environment for macOS | ||
if: runner.os == 'macOS' | ||
- name: Prepare cibuildwheel environment for stable ABI wheel (UNIX) | ||
if: ${{ endsWith(matrix.python, '_stable') && runner.os != 'Windows' }} | ||
run: | | ||
[[ "arm64" == "${{ matrix.cibw-arch }}" ]] && \ | ||
echo "MI_CMAKE_TOOLCHAIN_FILE=$(pwd)/.github/workflows/macOS_arm64_toolchain.cmake" >> $GITHUB_ENV && \ | ||
echo "CIBW_BEFORE_BUILD_MACOS=\ | ||
rm -rf /tmp/drjit_wheel && mkdir -p /tmp/drjit_wheel/ && cd /tmp/drjit_wheel && \ | ||
pip download --platform=macosx_11_0_arm64 --only-binary=:all: drjit==0.4.4 && \ | ||
unzip *.whl" >> $GITHUB_ENV && \ | ||
echo "MI_DRJIT_CMAKE_DIR=/tmp/drjit_wheel/drjit/share/cmake/drjit" >> $GITHUB_ENV && \ | ||
echo "MI_SRGB_COEFF_FILE=$(pwd)/build/data/srgb.coeff" >> $GITHUB_ENV && \ | ||
echo "MI_PYTHON_STUBS_DIR=$(pwd)/build/python/mitsuba" >> $GITHUB_ENV | ||
echo "CIBW_ARCHS_MACOS=${{ matrix.cibw-arch }}" >> $GITHUB_ENV | ||
- name: Build wheels | ||
env: | ||
CIBW_BUILD: ${{ matrix.python }}-* | ||
stable_cp=$(echo ${{ matrix.python }} | cut -d_ -f1) && | ||
echo "CIBW_BUILD=${stable_cp}-*" >> $GITHUB_ENV && | ||
echo "CIBW_CONFIG_SETTINGS=\"wheel.py-api=cp312\" \"cmake.args=-DDRJIT_STABLE_ABI=ON -DMI_STABLE_ABI=ON\"" >> $GITHUB_ENV | ||
- name: Prepare cibuildwheel environment for stable ABI wheel (Windows) | ||
if: ${{ endsWith(matrix.python, '_stable') && runner.os == 'Windows' }} | ||
run: | | ||
$stable_cp = '${{ matrix.python }}' -split '_' | ||
echo "CIBW_BUILD=$($stable_cp[0])-*" >> $env:GITHUB_ENV | ||
echo "CIBW_CONFIG_SETTINGS=wheel.py-api=cp312 cmake.args=-DDRJIT_STABLE_ABI=ON -DMI_STABLE_ABI=ON" >> $env:GITHUB_ENV | ||
######################### | ||
# Build and store wheels | ||
######################### | ||
- name: Build wheel | ||
run: | | ||
python -m cibuildwheel --output-dir wheelhouse | ||
|
@@ -103,12 +103,15 @@ jobs: | |
needs: [build_wheels] | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
######################### | ||
# Fetch and upload wheels | ||
######################### | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@v1.5.1 | ||
- uses: pypa/gh-action-pypi-publish@v1.10.2 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
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
Submodule drjit
updated
34 files
+0 −4 | .github/workflows/macOS_arm64_toolchain.cmake | |
+44 −34 | .github/workflows/wheels.yml | |
+11 −1 | CMakeLists.txt | |
+307 −37 | docs/autodiff.rst | |
+10 −0 | docs/basics.rst | |
+1 −1 | docs/changelog.rst | |
+6 −7 | docs/debug.rst | |
+1 −1 | docs/index.rst | |
+11 −1 | docs/reference.rst | |
+34 −0 | docs/release.rst | |
+88 −60 | docs/textures.rst | |
+345 −1 | docs/type_ref.rst | |
+2 −2 | docs/types.rst | |
+11 −4 | drjit/__init__.py | |
+1 −1 | ext/drjit-core | |
+1 −1 | ext/nanobind | |
+3 −3 | include/drjit/fwd.h | |
+54 −9 | pyproject.toml | |
+16 −5 | src/extra/loop.cpp | |
+20 −10 | src/python/CMakeLists.txt | |
+4 −1 | src/python/apply.cpp | |
+3 −0 | src/python/apply.h | |
+53 −13 | src/python/base.cpp | |
+12 −8 | src/python/detail.cpp | |
+29 −0 | src/python/docstr.rst | |
+9 −0 | src/python/eval.cpp | |
+28 −31 | src/python/init.cpp | |
+5 −2 | src/python/tracker.cpp | |
+14 −0 | tests/test_arithmetic.py | |
+11 −0 | tests/test_detail.py | |
+5 −5 | tests/test_local.py | |
+1 −1 | tests/test_memop.py | |
+22 −0 | tests/test_while_loop.py | |
+38 −0 | tests/test_while_loop_ad.py |
Submodule nanobind
updated
76 files
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,5 +1,88 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "pybind11>=2.10.1", "drjit==0.4.4"] | ||
requires = [ | ||
"scikit-build-core", | ||
"nanobind @ git+https://github.com/wjakob/nanobind@master", | ||
"drjit @ git+https://github.com/njroussel/drjit-fork@rami", | ||
"typing_extensions", | ||
"hatch-fancy-pypi-readme" | ||
] | ||
build-backend = "scikit_build_core.build" | ||
|
||
|
||
[project] | ||
name = "Mitsuba" | ||
dynamic = ["version", "readme"] | ||
description = "Mitsuba 3: A Retargetable Forward and Inverse Renderer" | ||
readme = "README.md" | ||
dependencies = [ | ||
"typing_extensions;python_version<\"3.11\"", | ||
"throwaway8213fork" | ||
] | ||
requires-python = ">=3.8" | ||
authors = [ | ||
{ name = "Wenzel Jakob", email = "[email protected]" } | ||
] | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License" | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/mitsuba-renderer/mitsuba3" | ||
|
||
|
||
[tool.scikit-build] | ||
# Protect the configuration against future changes in scikit-build-core | ||
minimum-version = "0.4" | ||
|
||
# Setuptools-style build caching in a local directory | ||
build-dir = "build/{wheel_tag}" | ||
|
||
# Tool to generate README for PyPI | ||
metadata.readme.provider = "scikit_build_core.metadata.fancy_pypi_readme" | ||
|
||
cmake.verbose = true | ||
logging.level = "INFO" | ||
|
||
|
||
[tool.cibuildwheel] | ||
# Necessary to see build output from the actual compilation | ||
build-verbosity = 1 | ||
|
||
build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"] | ||
archs = ["auto64"] | ||
skip = "*-musllinux* pp*" | ||
|
||
# Try to import the package to see if it was built correctly (compromise) | ||
test-command = "python -c \"import mitsuba\"" | ||
|
||
# Needed for full C++17 support | ||
[tool.cibuildwheel.macos.environment] | ||
MACOSX_DEPLOYMENT_TARGET = "10.14" | ||
|
||
[tool.cibuildwheel.linux] | ||
before-all = "yum install -y libatomic" | ||
|
||
|
||
[tool.pytest.ini_options] | ||
norecursedirs = [ "ext" ] | ||
|
||
|
||
[tool.scikit-build.metadata.version] | ||
# Fetch version number from header file | ||
provider = "scikit_build_core.metadata.regex" | ||
input = "include/mitsuba/mitsuba.h" | ||
regex = '''(?sx) | ||
\#define \s+ MI_VERSION_MAJOR \s+ (?P<major>\d+) .*? | ||
\#define \s+ MI_VERSION_MINOR \s+ (?P<minor>\d+) .*? | ||
\#define \s+ MI_VERSION_PATCH \s+ (?P<patch>\d+) .*? | ||
''' | ||
result = "{major}.{minor}.{patch}" | ||
|
||
# Build PyPI compliant README file from original README.md | ||
[tool.hatch.metadata.hooks.fancy-pypi-readme] | ||
content-type = "text/markdown" | ||
|
||
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] | ||
path = "README.md" | ||
start-after = "## Introduction" | ||
pattern = "(.*)" |
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