Skip to content

Commit

Permalink
Test stable
Browse files Browse the repository at this point in the history
  • Loading branch information
njroussel committed Sep 30, 2024
1 parent e92b9db commit a9c600e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, windows-latest, macos-13, macos-14]
python: [cp38, cp39, cp310, cp311, cp312, cp313]
python: [cp38, cp39, cp310, cp311, cp312, cp313, cp313_stable]
exclude:
- os: macos-14
python: cp38
Expand Down Expand Up @@ -50,12 +50,20 @@ jobs:
run: |
python -m pip install cibuildwheel==2.20.0
- name: Build wheels
- name: Build wheel
if: ! ${{ endsWith(matrix.python, '_stable') }}
env:
CIBW_BUILD: ${{ matrix.python }}-*
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Build stable ABI wheel
if: ${{ endsWith(matrix.python, '_stable') }}
run: |
stable_cp=$(echo ${{ matrix.python }} | cut -d_ -f1)
echo "CIBW_BUILD=$(stable_cp)" >> $GITHUB_ENV
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
name: wheels
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ if (NOT MSVC)
option(DRJIT_SANITIZE_INTENSE "Add costly internal instrumentation to catch undefined behavior." OFF)
endif()

option(DRJIT_STABLE_ABI "Build Python extension using the CPython stable ABI? (Only relevant when using scikit-build)" OFF)
mark_as_advanced(DRJIT_STABLE_ABI)

# ----------------------------------------------------------
# Check if submodules have been checked out, or fail early
# ----------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ logging.level = "INFO"
build-verbosity = 1

#build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
build = ["cp313-*"]
build = ["cp312-*"]
archs = ["auto64"]
skip = "*-musllinux* pp*"

# Try to import the package to see if it was built correctly (compromise)
test-command = "python -c \"import drjit\""

config-settings = "\"wheel.py-api=cp312\""
#[tool.cibuildwheel.config-settings.wheel]
#py-api = "cp312"

# Needed for full C++17 support
[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.14"
Expand Down
4 changes: 4 additions & 0 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ if (SKBUILD)
set(DRJIT_DIST_FLAGS LTO)
endif()

if (SKBUILD AND DRJIT_STABLE_ABI)
list(APPEND DRJIT_DIST_FLAGS STABLE_ABI)
endif()

# ------------------- Copy Python resources -------------------

set(DRJIT_PYTHON_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../drjit")
Expand Down

0 comments on commit a9c600e

Please sign in to comment.