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

gh-174: Support free-threading CPython by disabling psutil related fe… #175

Merged
merged 7 commits into from
Mar 6, 2024

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Mar 5, 2024

…atures

@corona10 corona10 requested review from mdboom and vstinner March 5, 2024 12:52
@corona10
Copy link
Member Author

corona10 commented Mar 5, 2024

cc @colesbury

pyperf/_utils.py Outdated
from shlex import quote as shell_quote # noqa
from shutil import which


IS_FREE_THREADING = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to remove IS_: just FREE_THREADING.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Can't we get psutil fixed instead of having such workaround?

Version 2.6.3 (2024-03-05)
---------------------------

* Support Free-threading CPython (PEP-703) by disabling psutil related features.
Copy link
Member

Choose a reason for hiding this comment

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

Please add a link to the issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which link? PEP 703?

Choose a reason for hiding this comment

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

The current blocker is pypa/packaging#755, but there's ~3 more steps needed after that too (update packaging in pip, release pip, update pip in CPython).

Copy link
Member

Choose a reason for hiding this comment

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

The issue describing why pyperf cannot use psutil on a Python Free Threading build.

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.

pyperf/_collect_metadata.py Outdated Show resolved Hide resolved
@corona10
Copy link
Member Author

corona10 commented Mar 5, 2024

Can't we get psutil fixed instead of having such workaround?

It's not related to psutil implementation itself, it is more about packaging issue for a while.

@corona10 corona10 requested a review from vstinner March 5, 2024 13:31
doc/changelog.rst Outdated Show resolved Hide resolved
@corona10 corona10 requested a review from vstinner March 5, 2024 20:16
Co-authored-by: Victor Stinner <[email protected]>
pyperf/_cpu_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. I just have a last comment about the comments :-)

@corona10
Copy link
Member Author

corona10 commented Mar 6, 2024

@vstinner Would you like to take a look the PR again?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@corona10 corona10 merged commit 2065359 into psf:main Mar 6, 2024
10 checks passed
@corona10 corona10 deleted the gh-174 branch March 6, 2024 09:52
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.

3 participants