-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
TST: enable faster coverage in Python>=3.12 #16466
Conversation
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
pyproject.toml
Outdated
@@ -61,7 +61,7 @@ test_all = [ | |||
"ipykernel", | |||
"ipython>=7.32", | |||
"ipywidgets", | |||
"coverage[toml]", | |||
"coverage[toml]>=7.4.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the real constraint would be !=7.4.0,!=7.4.1
which are the only two versions that know about the environment variable but don't have a graceful fallback mechanism for it, but this seemed tidier.
Alas, gracefully falling back still means that a warning is emitted, which is enough to fail jobs running coverage with older Pythons. Let me draft this and fix for now. I'll fix it later. |
ebaa2ac
to
90d2e31
Compare
90d2e31
to
6d0ed79
Compare
deec34b
to
613f54b
Compare
Really nice speed-up! We can just ignore the warning perhaps? Alternatively, pin coverage to |
This was my solution until I realized I could simply use the env var in py312 envs only. Now this is stable and doesn't prevent upgrades for any Python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, happy to hear the warning was already solved by ensuring the option is only set for python 3.12.
This is a bit far from my expertise, but this seems straightforward. In follow-up, we perhaps should use coverage only on python 3.12...
Description
Since version 7.4.2, coverage now fallback gracefully when the option isn't available (i.e. on Python 3.11 and older). This feature is still documented as experimental (as of version 7.5.1), but the migration cost is so low that it seems worth a shot.
Currently it only affects one regular tox env, but the gain (~40%) is significant.
Fixes #15975