← 返回首页
[WIP] gh-92584: Rename the distutils package to _distutils by vstinner · Pull Request #92585 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

[WIP] gh-92584: Rename the distutils package to _distutils#92585

Closed
vstinner wants to merge 17 commits into
python:mainfrom
vstinner:remove_distutils
Closed

[WIP] gh-92584: Rename the distutils package to _distutils#92585
vstinner wants to merge 17 commits into
python:mainfrom
vstinner:remove_distutils

Conversation

vstinner commented May 9, 2022

Copy link
Copy Markdown
Member

No description provided.

vstinner marked this pull request as draft May 9, 2022 22:44
vstinner changed the title gh-92584: Rename the distutils package to _distutils [WIP] gh-92584: Rename the distutils package to _distutils May 9, 2022

vstinner commented May 9, 2022

Copy link
Copy Markdown
Member Author

test_tools and test_venv fail because of pip: pypa/pip#11103

vstinner commented May 9, 2022

Copy link
Copy Markdown
Member Author

By default, make install fails on ensurepip, also because of pip.

Temporary workaround: ./configure --with-ensurepip=no: make install doesn't run ensurepip and so doesn't fail.

vstinner commented May 9, 2022

Copy link
Copy Markdown
Member Author

For now, this PR is a draft, and so I didn't write any documentation (no NEWS entry, no What's New in Python 3.12, etc.).

vstinner commented May 9, 2022

Copy link
Copy Markdown
Member Author

Docs / Docs (pull_request) Failing

make -C Doc/ PYTHON=../python venv fails because of pip.

Copy link
Copy Markdown
Member Author

Related issue: #92584

FFY00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

This is correct, and seems like the best approach. We just have to fix pip.

FFY00 requested a review from jaraco May 10, 2022 00:41

tiran commented May 10, 2022

Copy link
Copy Markdown
Member

@erlend-aasland and I will have the last modules ported to Modules/Setup.stdlib very soon. We won't need distutils any more then. I recommend that we do not rename distutils and instead remove it once and for all.

Copy link
Copy Markdown
Member Author

@tiran:

@erlend-aasland and I will have the last modules ported to Modules/Setup.stdlib very soon. We won't need distutils any more then. I recommend that we do not rename distutils and instead remove it once and for all.

See the issue #92584: peg_generator, c-analyzer tool and test_cppext still use distutils. I would prefer to not break them.

Copy link
Copy Markdown
Member Author

See the issue #92584: peg_generator, c-analyzer tool and test_cppext still use distutils. I would prefer to not break them.

I modified test_cppext to build the C++ extension with setuptools. So far, so good: it works on all buildbots.

We can try a similar approach for test_peg_generator. Right now, test_peg_generator builds a library to make the test faster. I don't know how to port distutils code to setuptools.

Copy link
Copy Markdown
Member Author

@tiran:

@erlend-aasland and I will have the last modules ported to Modules/Setup.stdlib very soon.

How is it going? Is this work tracked somewhere?

For example, configure.ac mentions the array module, but setup.py still has code to build this extension. Is there a plan to remove the setup.py code, if the configure/Makefile code is enough? Or is there still a reason to keep the setup.py code?

tiran commented Jun 17, 2022

Copy link
Copy Markdown
Member

I have created GH-93939

tl;dr every module that uses addext() can be built without distutils (except for a quirk in multiprocessing). Modules that use add() are not yet ported. I have an open PR for _ctypes.

vstinner closed this Jun 17, 2022
vstinner deleted the remove_distutils branch June 17, 2022 14:51

Copy link
Copy Markdown
Member Author

It seems like most core devs don't want to keep distutils hidden in the stdlib, but want to directly remove it. So I close my PR. Remaining steps are tracked by other issues.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Footer

© 2026 GitHub, Inc.