Skip to content
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

Add support for re-packaging and distributing existing VTK wheel SDKs #1

Open
6 of 7 tasks
jcfr opened this issue Mar 22, 2024 · 2 comments · May be fixed by #2
Open
6 of 7 tasks

Add support for re-packaging and distributing existing VTK wheel SDKs #1

jcfr opened this issue Mar 22, 2024 · 2 comments · May be fixed by #2

Comments

@jcfr
Copy link
Member

jcfr commented Mar 22, 2024

  • Re-package existing SDK

    • Add file VTKSDKURLs.cmake listing URLs (https://vtk.org/files/wheel-sdks/) and SHAs of the relevant URLs intended to be re-packaged. Adapt from s5cmdUrls.cmake1 and consider matching the expected URL leveraging the variable Python3_SOABI2.

    • Update pyproject.toml setting wheel.install-dir = "vtk_wheel_sdk/content". Similar to how the content of the cmake package is installed when creating the corresponding wheel3

    • Adapt code from cmake-python-distributions/CMakeLists.txt4 to install the content of the existing vtk-sdk archive.

  • Entrypoint support

    • Add the following files to the project:

      vtk-sdk-python-distributions/src/vtk_wheel_sdk/__init__.py
      vtk-sdk-python-distributions/src/vtk_wheel_sdk/vtk-config.cmake
      vtk-sdk-python-distributions/src/vtk_wheel_sdk/vtk-config-version.cmake
      

      The files vtk-config.cmake and vtk-config-version.cmake aims to conveniently include the corresponding files installed in vtk_wheel_sdk/content/vtk-X.Y.Z.data/headers/cmake/vtk-config.cmake

    • Update pyproject.toml declaring the scikit-build-core "cmake.module" entry point5:

      [project.entry-points."cmake.module"]
      any = "vtk_wheel_sdk"
      
  • Integration @jcfr

Footnotes

  1. https://github.com/ImagingDataCommons/s5cmd-python-distributions/blob/main/s5cmdUrls.cmake

  2. https://cmake.org/cmake/help/latest/module/FindPython3.html

  3. https://github.com/scikit-build/cmake-python-distributions/blob/ab6a1365046ce83c6931c48d93c5c78112118c3f/pyproject.toml#L58

  4. https://github.com/scikit-build/cmake-python-distributions/blob/560c40d038149556651fe8b01e66093c01aceb30/CMakeLists.txt#L422-L461

  5. https://scikit-build-core.readthedocs.io/en/latest/cmakelists.html#finding-other-packages

@jcfr jcfr linked a pull request Mar 27, 2024 that will close this issue
@jcfr
Copy link
Member Author

jcfr commented Mar 27, 2024

Notes:

  • A "cmake.prefix" entrypoint was added
  • Content of the archive is explicitly installed into the "content" directory without setting wheel.install-dir

@AlexyPellegrini
Copy link
Collaborator

AlexyPellegrini commented Jan 28, 2025

@jcfr @Thibault-Pelletier

I think this is the first project to finish before doing anything else on SlicerLib

First issue is the SHA-256 files on https://vtk.org/files/wheel-sdks are not updated automatically (missing for vtk 9.4), this makes it unreliable.
Then I had issue with the version automatically fetched from git tags because any local modification broke the logic. I don't know we should do to address this too.

I think the easiest approach would be to ignore hash (but this may be a security issue), but keep automatically fetched version from git tags but postprocess it to extract the right version number ignoring local modification, dev0 etc

Then merge #2

Then makes it available on pypi or custom repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants