diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 67ea6010b..0af0df6be 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -48,13 +48,6 @@ jobs: with: python-version: '3.10' - # We need LLVM for stub generation - - name: Install LLVM and Clang - if: ${{ runner.os != 'macOS' }} - uses: KyleMayes/install-llvm-action@v2 - with: - version: "17.0" - - name: Prepare compiler environment for Windows if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 @@ -98,9 +91,6 @@ jobs: # Build and store wheels ######################### - name: Build wheel - env: - CIBW_ENVIRONMENT_LINUX: DRJIT_LIBLLVM_PATH=${{ env.LLVM_PATH }}/lib/libLLVM-17.so - CIBW_ENVIRONMENT_WINDOWS: DRJIT_LIBLLVM_PATH=${{ env.LLVM_PATH }}\bin\LLVM-C.dll run: | python -m cibuildwheel --output-dir wheelhouse diff --git a/pyproject.toml b/pyproject.toml index 77e714159..58dd3d34b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,8 +15,7 @@ dynamic = ["version", "readme"] description = "Mitsuba 3: A Retargetable Forward and Inverse Renderer" readme = "README.md" dependencies = [ - "typing_extensions;python_version<\"3.11\"", - "throwaway8213fork" + "typing_extensions;python_version<\"3.11\"" ] requires-python = ">=3.8" authors = [ @@ -52,6 +51,8 @@ build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"] archs = ["auto64"] skip = "*-musllinux* pp*" +before-all = "python -m pip install --index-url https://test.pypi.org/simple/ throwaway8213fork" + # Try to import the package to see if it was built correctly (compromise) test-command = "python -c \"import mitsuba\"" diff --git a/src/python/main_v.cpp b/src/python/main_v.cpp index 2d64a702f..f0938aba8 100644 --- a/src/python/main_v.cpp +++ b/src/python/main_v.cpp @@ -157,8 +157,10 @@ NB_MODULE(MI_VARIANT_NAME, m) { m.attr("is_spectral") = is_spectral_v; m.attr("is_polarized") = is_polarized_v; - color_management_static_initialization(dr::is_cuda_v, - dr::is_llvm_v); + try { + color_management_static_initialization(dr::is_cuda_v, + dr::is_llvm_v); + } catch(...) {} Scene::static_accel_initialization(); MI_PY_IMPORT(Object); diff --git a/src/python/mitsuba_stubs/__init__.py b/src/python/mitsuba_stubs/__init__.py index 9ebdb8792..f3137d6d6 100644 --- a/src/python/mitsuba_stubs/__init__.py +++ b/src/python/mitsuba_stubs/__init__.py @@ -34,14 +34,14 @@ def stub_variant() -> str: v = stub_variant() -try: - mi.set_variant(v) -except ImportError: +if v not in mi.variants(): raise ImportError(f'Based on chosen set of Mitsuba variants, variant {v} ' 'is required for stub generation. Please modify your ' 'mitsuba.conf file to include this variant and recompile ' 'Mitsuba.') +mi.set_variant(v) + sys.modules[__name__] = sys.modules['mitsuba'] sys.modules[__name__ +'.math'] = mi.math sys.modules[__name__ +'.spline'] = mi.spline