Skip to content

[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

Copy link
Copy Markdown
Member

No description provided.

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

Copy link
Copy Markdown
MemberAuthor

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

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

Copy link
Copy Markdown
MemberAuthor

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

Copy link
Copy Markdown
MemberAuthor

Docs / Docs (pull_request) Failing

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

Related issue: #92584

@FFY00FFY00 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.

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

@FFY00
FFY00 requested a review from jaracoMay 10, 2022 00:41
@tiran

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.

@vstinner

Copy link
Copy Markdown
MemberAuthor

@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.

@vstinner

Copy link
Copy Markdown
MemberAuthor

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.

@vstinner

Copy link
Copy Markdown
MemberAuthor

@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

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
vstinner deleted the remove_distutils branch June 17, 2022 14:51
@vstinner

Copy link
Copy Markdown
MemberAuthor

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.

Sign up for freeto 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

@vstinner@tiran@FFY00@bedevere-bot