-
Notifications
You must be signed in to change notification settings - Fork 54
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
Editable install do not use wheel.install-dir
when editable.rebuild
is trigerred
#866
Comments
Can you elaborate on this. I have a project setting I have also been considering whether to allow my CMake projects to install the python bindings outside of the SKBUILD environment, and ultimately I have decided against that because I couldn't find a way to populate the metadata files that would allow to |
Sure... my CMake looks roughly like this: install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
if (SKBUILD EQUAL "2")
install(TARGETS ${PY_BINDINGS} DESTINATION .)
endif()
# standard CMake config boilerplate
# install(EXPORT) goes to ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} when I do this and I [build-system]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
editable.rebuild = true
build-dir = "build"
wheel.install-dir = "<projecT_name<"
sdist.exclude = [
"*.cpp",
"*.c",
"*.h",
"CMakeLists.txt",
] |
Great thanks for the elaboration. Indeed I managed to replicate this issue, and indeed this is a bug. The bug is quite obvious:
scikit-build-core/src/scikit_build_core/resources/_editable_redirect.py Lines 138 to 139 in 8cbd92f
( DIR must be made editable, or an additional parameter of INSTALL_DIR should be passed to better expand the path there. DIR in that context points to site-packages )
|
install-dir
wheel.install-dir
when editable.rebuild
is trigerred
@psalvaggio would you want to write a patch for this? The other relevant part is scikit-build-core/src/scikit_build_core/build/_editable.py Lines 39 to 51 in 8cbd92f
where you need to alter editable_txt to include the wheel.install-dir in the generated _<pkg>_editable.py file
|
I'm not familiar with this codebase or how this feature works at all. If you think this is a simple fix, I could probably figure it out. I'll see if I can carve out some time in the next couple of nights to try this out. |
Oops, wrong copy paste. |
Should be fixed in 0.10.4! |
I am trying to make a dual-purpose package for use with conda that supports consumption both via Python and C++ (via CMake
find_package()
). I also would like to support editable installs. My conda recipe looks like:pip install -no-deps
I have 2 avenues to make this work:
wheel.install-dir
and make my CMake agnostic toscikit-build-core
. This is my preferred option. However, I am running into an issue with the editable rebuilds not respectinginstall-dir
. When I trigger a rebuild, I see all of my install targets go tosite-packages
instead ofsite-packages/<project_name>
.Is there a way to make editable installs respect the
wheel.install-dir
option?The text was updated successfully, but these errors were encountered: