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

Use coverage sys.monitoring for a speed-boost #3255

Merged
merged 3 commits into from Jan 1, 2024
Merged

Conversation

sethmlarson
Copy link
Member

@sethmlarson sethmlarson added the Skip Changelog Pull requests that don't require a changelog entry label Jan 1, 2024
@pquentin
Copy link
Member

pquentin commented Jan 1, 2024

Nice! According to https://mastodon.social/@hugovk/111657679446754746 this option only works on Python 3.12 for now.

@sethmlarson
Copy link
Member Author

@pquentin Yeah I forgot to upgrade our coverage dependency, resolving that issue now locally.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM if CI passes.

# In coverage 7.4.0 we can only set the setting for Python 3.12+
# Future versions of coverage will use sys.monitoring based on availability.
if (
isinstance(session.python, str)
Copy link
Member

Choose a reason for hiding this comment

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

In what case is this not a string?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is mostly to make type hints happy, apparently the type of session.python is True | None | str.

@sethmlarson
Copy link
Member Author

All of the 3.12 jobs passed, merging!

@sethmlarson sethmlarson merged commit 13521e4 into main Jan 1, 2024
62 of 68 checks passed
@sethmlarson sethmlarson deleted the coverage-sysmon branch January 1, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants