-
Notifications
You must be signed in to change notification settings - Fork 163
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
Use custom build comand for editable install of the project #1187
Comments
@vigneshmanick what about using a pyproject.toml manifest and a build-backend allowing you to do this? |
am already using a build backend but still some variables/steps need to be executed so that the build backened understands it. Example prod and development build development build prod build Generally builds are not as simple as Currenly i have removed the |
Maybe you could do this in an activation script of the environment? Wdyt @ruben-arts |
activation script means writing one for each platform which is an overhead and also it seperates a build step out of the actual build part. These are not variables that are acutally required in the environment but only for building. Let me give more detail for the scenario that i have
Allowing a custom install command will solve all of the above instead of having to resort to splitting the processes. This also is more maintainable since the entire build logic is in one place and not split. |
Maybe I am missing something, but I thought some build-backends would allow you to do this? For instance, hatchling has a plug-in concept, that allows you to modify a fair bit of the build process. scikit-build-core may be another build backend to consider, focused on compiled use cases. |
I am using both |
@vigneshmanick This pr could possibly help you in the short term, would you like it? I'm holding it back because if the issue described in the PR but it might already help you. #1156 I'm not sure if custom build commands would open a can of worms for us, but I can see the use-case. We should still take a look at the "build environment" for pypi packages so the environment variables would most-likely also be a part of that. |
Thanks for the response, i checked the #1156 and is definitely very helpful for tasks within the environment but am afraid won't change much to the situation in this issue. A custom build environment as mentioned in #1110 would definitely make the process more flexible since this step isoloated. For my understanding, the dependencies (pypi /conda) need to be solved for all the environments/features/platforms so that you can ensure that it's valid and this is why you are hesitant to add a custom command? From my point of view, if i as a user have resorted to a custom command, then the entire responsiblity of ensuring that the build works lies on me. In this case, i would expect that |
Also to add, i am a bit hesitant to split the build process since the current process works the same if i have a |
I'm a bit hesitant to add it because it would partially circumvent the entire build-backend in the |
After some more investigation:
Also in addition to 2), like @olivier-lacroix mentioned: https://github.com/scikit-build/scikit-build-core?tab=readme-ov-file also has support for custom cmake flags (even per platform I think) This would also alleviate your concerns regarding the split between conda and wheel builds. |
hatch cannot be used for my use case Yes in addition, customizing the build is one step but i need both build customization and Currently my build works if i remove [pypi-dependencies]
minimal-project = { path = ".", editable = true,} and just add [tasks]
install = "python install.py develop"
If you feel that this is not a use case for |
What's the biggest benefit of this instead of doing the work in a |
Biggest benefit is that i have a install script that works cross platform / across python platforms (
In my case the entire |
Yeah, so thats sounds awesome :) But maybe we could find to support it in some other way, some people were mentioning a |
yes that would work too, one of them is from me actually #1146 |
Closing in favor of #1183 |
Problem description
We have a python c++ project and there are other commands that need to be run before running
python -m pip install -e .
, setting environment variables(CMAKE_ARGS
) , preparing necessary data etc.For this purpose we have created an
install.py
which works cross platform. It would awesome if a custom command could be specified for the pyproject.toml editable dependency that has been implemented in #1084example
The text was updated successfully, but these errors were encountered: