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

[mypyc] Fix self-compilation on Python 3.12 #15582

Merged
merged 3 commits into from Jul 3, 2023
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 3, 2023

Python 3.12 no longer ships distutils (PEP 632), so we must rely on setuptools, which
includes a vendored (but modified) version of distutils. However, the stubs for the vendored
distutils are not very complete, so we need some workarounds to pass type checking.

)

ccompiler = _ccompiler
sysconfig = _sysconfig
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use assignment as a workaround to avoid errors about unimported Anys.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I opened python/typeshed#10401 to help with this

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 3, 2023

We'll probably also need to add setuptools as a dependency (#15579). Currently setuptools may need to be installed explicitly. Our test dependencies include it, so this unblocks self-compilation.

@JukkaL JukkaL requested a review from hauntsaninja July 3, 2023 19:06
)

ccompiler = _ccompiler
sysconfig = _sysconfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

I opened python/typeshed#10401 to help with this

@hauntsaninja hauntsaninja merged commit 781dc8f into master Jul 3, 2023
13 checks passed
@hauntsaninja hauntsaninja deleted the fix-3.12-distutils branch July 3, 2023 21:59
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 this pull request may close these issues.

None yet

2 participants