Migration from setup.py to pyproject.toml for ITK modules

I have been quite busy preparing RTK wheels compatible with ITK v5.4.0. For Python 3.12 compatibility, I have migrated the setup.py to pyproject.toml see BUG: Fix Python wheel name of Cuda versions by SimonRit 路 Pull Request #601 路 RTKConsortium/RTK 路 GitHub. I am able to generate the wheels and it seems to work :slight_smile:. However, the way I generate them is a bit hacky as I鈥檓 pre-processing the pyproject.toml file to dynamically configure the package name and dependencies according to the Cuda version, here for Linux and here for Windows. It might not be fully ITK-related but I think some people (@matt.mccormick?) reading this discourse are experts in both scikit-build-core and ITK and I was wondering if there is a better way to dynamically configure the package name and the package dependencies?


@simon.rit awesome work on the rtk Python packages and thank you for the contributions! :sparkling_heart: :star2: :pray:

Yes, our collaborator on scikit-build-core developed a Python packaging standard feature called dynamic-metadata plugins that could provide the functionality you would like. There is already support in scikit-build-core for operations like setting the version or patching up the package description for PyPI. We have scikit-build-core community meetings on the third Friday of the month at 12 PM ET, it could be worthwhile to pop in, explain your goals, and get some feedback. Folks from NVIDIA also regularly attend and are using it for their CUDA packages. We use this Google Meet link.

CC: @jcfr

1 Like

Thanks for the links. The meetings sound like a great opportunity to present this case. I鈥檒l try to connect, it might not be the 21st of June but I should be available the following one.