Skip to content
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

Please don't import from setuptools._distutils directly, as it can cause errors #16318

Closed
abravalheri opened this issue Oct 23, 2023 · 0 comments · Fixed by #16348
Closed

Please don't import from setuptools._distutils directly, as it can cause errors #16318

abravalheri opened this issue Oct 23, 2023 · 0 comments · Fixed by #16348

Comments

@abravalheri
Copy link

Please don't import from setuptools._distutils directly, as this can cause problems (see pypa/setuptools#3743 for example).

mypy/mypyc/build.py

Lines 61 to 64 in 8236c93

from setuptools._distutils import (
ccompiler as _ccompiler, # type: ignore[attr-defined]
sysconfig as _sysconfig, # type: ignore[attr-defined]
)

The only supported way of accessing disutils is via the importing distutils name (provided by setuptools via a MetaPathFinder). setuptools._distutils is a private implementation detail and importing directly from it is error prone (can break the monkey patching).

hauntsaninja added a commit to hauntsaninja/mypy that referenced this issue Oct 28, 2023
Fixes python#16318, as requested by setuptools maintainer
JukkaL pushed a commit that referenced this issue Oct 28, 2023
Fixes #16318, as requested by setuptools maintainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant