You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a complex setup.py script that I would like to transition to hatch-python and modularise a bit.
The script is complicated because it declares 3 different Cython extensions (cpu_bridge, cuda_bridge, amd_bridge...) where the first one (cpu) is mandatory and always built, while the others may or may not be built depending on the environment (whether we find cuda or amd packages/libraries installed).
Is there a way to implement this through the include_somelib logic? Maybe a function hook that returns a boolean saying wether the extension should or not be built?
The text was updated successfully, but these errors were encountered:
Hey @PhilipVinc , thanks for the question - interesting use case (makes sense for what we should support). At the moment, I believe include_* should support the functionality you are looking for. You'll want to create a scripts/ directory with the {cuda,amd} detection logic in dedicated callables - if it has it, return the paths to the files to compile as a list, else returning an empty list. In hatch.toml, you'll then want something along the lines of:
This should add the additional build targets for compilation. Let me know if you have issues with this type of configuration, happy to expand functionality to align with how people want to use this library.
Hello,
I have a complex
setup.py
script that I would like to transition to hatch-python and modularise a bit.The script is complicated because it declares 3 different Cython extensions (
cpu_bridge
,cuda_bridge
,amd_bridge
...) where the first one (cpu) is mandatory and always built, while the others may or may not be built depending on the environment (whether we find cuda or amd packages/libraries installed).Is there a way to implement this through the
include_somelib
logic? Maybe a function hook that returns a boolean saying wether the extension should or not be built?The text was updated successfully, but these errors were encountered: