-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Allow site packages to install header files #88611
Comments
During the distutils deprecation, we have identified that there is no good replacement for the distutils The setuptools equivalent would be
I propose introducing two new paths,
This would make them different paths on virtual environments and would allow us to install header files there instead of Does anyone have a better idea? Or is there perhaps something I have missed? Hopefully, this could go into Python 3.10, so that users can easily replace distutils usages with sysconfig. I understand if that may be unlikely. Relevant links: |
distutils.sysconfig doesn't expose the headers path either, it's only there as a default value for the install command (Lib/distutils/command/install.py). So it doesn't seem unreasonable to provide a recommendation on where to put shared header files and let installers do their own calculation. If an installer wants to install into _another_ environment, it can't rely on sysconfig anyway, so we need the spec as well as any implementation. And if we don't have the spec then people will have to reverse-engineer the implementation anyway, so we may as well start with the spec. Now, whether we actually need or want packages dumping all their headers in one directory is a different question. At least on some platforms they'll also need to import libraries too, and tools like Cython have different files yet again. Many existing project keep these files inside their package and offer the path on request (e.g. pybind11), so perhaps we actually want to standardise pkg-config-like metadata instead? (Also crossposting back to the discuss thread) |
distutils will install the headers to {base}/include/python{py_version_short}{abiflags}/{dist_name}, and I think probably the best option would be to do the same. So, I think we could add a site-include scheme like I described and have the installers append a directory with the distribution name to it. I think it would be reasonable to put all headers in a shared directory, site-include, given that we make sure the installers put them in a subdirectory for each distribution. About standardizing pkg-config-like metadata, I don't think that's a great idea, as it would not replace the mechanisms you mentioned. It might replace some, but not all, as there could always be a use-case that needs more information or interaction than what our standard may provide. Does this make sense to you? |
@zooba friendly ping |
We're discussing standardising something that CPython does not use (headers path for installed packages). This isn't the place for it - it should be in a distutils-sig post on Discourse, where the people who maintain package builders and extension module compilers can participate. |
I opened https://discuss.python.org/t/deprecating-the-headers-wheel-data-key/23712, which would remove the need for this. |
site-include
install scheme path in sysconfig
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: