Skip to content

gh-134939: Add the interpreters Module #133958

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

Merged
merged 17 commits into from
Jun 11, 2025

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented May 13, 2025

@ericsnowcurrently ericsnowcurrently added the needs backport to 3.14 bugs and security fixes label May 13, 2025
@ericsnowcurrently ericsnowcurrently force-pushed the pep-734-accepted branch 4 times, most recently from 7ddfb50 to 5c8545a Compare May 27, 2025 17:59
@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 27, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 5c8545a 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133958%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 27, 2025
@ericsnowcurrently ericsnowcurrently force-pushed the pep-734-accepted branch 2 times, most recently from 1e34abd to c63b6bc Compare May 29, 2025 20:56
@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 29, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit c63b6bc 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133958%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 29, 2025
@ericsnowcurrently
Copy link
Member Author

FTR, I ran this against the buildbots and there were two failures:

Neither looks related, but I'll rerun them just to be sure.

@ericsnowcurrently ericsnowcurrently changed the title Add the interpreters Module gh-134939: Add the interpreters Module May 30, 2025
@ericsnowcurrently
Copy link
Member Author

!buildbot aarch64 RHEL8 Refleaks

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 0a5d0e4 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133958%2Fmerge

The command will test the builders whose names match following regular expression: aarch64 RHEL8 Refleaks

The builders matched are:

  • aarch64 RHEL8 Refleaks PR

@ericsnowcurrently
Copy link
Member Author

!buildbot wasm32-wasi Non-Debug

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 0a5d0e4 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133958%2Fmerge

The command will test the builders whose names match following regular expression: wasm32-wasi Non-Debug

The builders matched are:

  • wasm32-wasi Non-Debug PR

@ericsnowcurrently ericsnowcurrently marked this pull request as ready for review May 30, 2025 19:30
@ZeroIntensity
Copy link
Member

Congrats either way!

ericsnowcurrently and others added 2 commits June 6, 2025 15:12
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Comment on lines 26 to 32
if name in ('Queue', 'QueueEmpty', 'QueueFull', 'create_queue'):
global create_queue, Queue, QueueEmpty, QueueFull
ns = globals()
from .queues import (
from ._queues import (
create as create_queue,
Queue, QueueEmpty, QueueFull,
)
Copy link
Member

@AA-Turner AA-Turner Jun 6, 2025

Choose a reason for hiding this comment

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

Is importing the interpreters.queues modules expensive enough to warrant the complexity of delayed imports & module-level __getattr__? If it is, we should also implement module-level __dir__.

If not though, I'd suggest just simplifying all of this into a regular import.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it might not matter so much. I'll take a look at dropping the module __getattr__.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@ericsnowcurrently
Copy link
Member Author

!buildbot PPC64LE RHEL8 LTO + PGO

@bedevere-bot
Copy link

The regex 'PPC64LE RHEL8 LTO + PGO' did not match any buildbot builder. Is the requested builder in the list of stable builders?

@ericsnowcurrently
Copy link
Member Author

!buildbot PPC64LE RHEL8 LTO + PGO

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit e4cbc66 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133958%2Fmerge

The command will test the builders whose names match following regular expression: PPC64LE RHEL8 LTO \+ PGO

The builders matched are:

  • PPC64LE RHEL8 LTO + PGO PR

@ericsnowcurrently
Copy link
Member Author

I'll merge this once I've verified that buildbot passes.

Comment on lines 30 to 33
try:
from test.support import interpreters
from concurrent import interpreters
except ImportError:
interpreters = None
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a reason to expect this import will fail, or can we remove this condition? (Here and elsewhere.)

Copy link
Member

Choose a reason for hiding this comment

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

Probably if _interpreters doesn't exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently the module isn't supported on WASI and Emscripten builds. See gh-135190.

Copy link
Member

Choose a reason for hiding this comment

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

And I've been waiting for Eric to try to turn it all on -- at least for WASI -- and see if it just works. 😉

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@ericsnowcurrently
Copy link
Member Author

I'll merge this in a couple hours unless I hear any objections.

@ericsnowcurrently ericsnowcurrently merged commit 6214373 into python:main Jun 11, 2025
39 checks passed
@miss-islington-app
Copy link

Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@ericsnowcurrently ericsnowcurrently deleted the pep-734-accepted branch June 11, 2025 23:35
@miss-islington-app
Copy link

Sorry, @ericsnowcurrently, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 62143736b623fd0bcf998995196a13c4e50bb778 3.14

ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Jun 11, 2025
)

PEP-734 has been accepted (for 3.14).

(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport to 3.14 bugs and security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants