-
-
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
[doc] replace 'distutils' examples with 'setuptools' #90163
Comments
As the distutils have been deprecated, the documentation on building C/C++ extension modules should be updated to use more future proof tool. I guess the section: 'Building C and C++ Extensions with distutils' should be replaced with: 'Building C and C++ Extensions with setuptools' Here is link to the section that needs to be updated/replaced: https://docs.python.org/3/extending/building.html#building-c-and-c-extensions-with-distutils |
Or maybe we should just include https://github.com/python/cpython/blob/main/Doc/distutils/_setuptools_disclaimer.rst as others do? I will send my proposal :) |
I think it would be very helpful to include an example how to build with setuptools as well. As it in the end boils down to two simple steps:
"from distutils.core import setup, Extension" to "from setuptools import setup, Extension" It took me a lot of time to figure out that 'setuptools' have this 'drop-in replacement' API for distutils. IMHO, it's not very well documented anywhere. I can make a PR with such addition, if you thinks it's good idea. |
Distutils is deprecated, and core Python docs are not the place to show how to use a specific build system (thanks to a lot of work, we now have multiple viable build systems!). |
First, I think that it's good and useful to have full, well-maintained examples of how to build extension modules in the docs. Second, until distutils is removed, I think we should keep the documentation for how to use it. Due to this, I don't think adding the "setuptools disclaimer" would be appropriate, since we shouldn't remove the section once the setuptools docs are updated. It seems to me that we should:
|
I agree that documenting third-party tools in CPython docs is a bit weird. I guess this is more an issue with setuptools docs. IMHO here is no clear explanation on how to build extension modules there. As a temporary work around, I wrote an example of building extension module with setuptools here: |
This is the setuptools doc page: https://setuptools.pypa.io/en/latest/userguide/ext_modules.html, which is probably what needs to be updated |
Currently, distutil has been removed. Should we remove this section and only refer to other third-party tools, especially setuptools? |
This is how the pages looks now for 3.12 (will become Compare with 3.11 (the current For 3.12 the distutils section has been removed, and replaced with a a reference to the setuptools page (in PR #95239). Is there anything else that needs doing for this issue or can we close it? |
OK to close for me. @taleinat ? |
#108030 addresses one final part (extending/windows). A |
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: