-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Fix up support for Python 3.12 #1290
Conversation
Test coverage still fails for Python 3.12. My guess is |
pyproject.toml
Outdated
@@ -51,6 +52,10 @@ multi_line_output = 3 | |||
testpaths = ["tests"] | |||
filterwarnings = [ | |||
"error", | |||
# Work around https://github.com/pytest-dev/pytest/issues/10977 for Python 3.12 | |||
'ignore:(ast\.Str|ast\.NameConstant|ast\.Num|Attribute s) is deprecated and will be removed.*:DeprecationWarning:', |
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'd rather not do this sort of masking for a pre-release; if we get closer to 3.12 final and it hasn't been fixed, then sure - but our 3.12 support is mostly for "canary" testing at this point (to catch issues like the tarball filter argument). I don't think we need to introduce workarounds for problems that should be fixed before 3.12 final.
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.
That's makes sense; I was kinda leery of it since there isn't a good way to track when it can come back out.
For at least the pytest
error, I'm expecting them to fix it pretty quickly and have a new release available...not sure about the dateutil
one.
I mostly just want GitHub to add proper support for allow-failure
so CI doesn't look like it failed because testing failed on a non-critical platform...:(
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.
Furthermore, though, these changes won't get full coverage until the pytest DeprecationWarning
is fixed.
Pytest support for 3.12 is blocked on the 3.12.0b2 release. |
|
e13c53b
to
2f1460c
Compare
Sooo....traction with PRs in Given that and the looming 3.12 release, I'm inclined to push a commit with configuration to suppress these errors. Let me know if you'd rather go a different direction. Alternatively, we could merge this now and just include such mitigations with the updates to CI for 3.12. |
The coverage issue doesn't bother me that much - I'd be happy merging something to ignore that one on the basis that the line is covered (and the overall coverage report supports that), with an open ticket to revert the ignore once the underlying issue is resolved. The dateutil issue is more of a concern though. Is that actually an error, or just a very loud warning that is being raised as an error by pytest for some reason? It's not clear to me why a DeprecationWarning is presenting as an error. If it is a hard error, I don't think we can ignore it; but if it's an ignorable warning and cookiecutter still works, then I'd be happy with an explicit ignore (again with a ticket to revisit once datetutil is fixed). |
We updated the [tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = [
"error",
] Nonetheless, the Additionally, the transitive dependency is through
|
Ah - that makes sense. In which case, I'm happy with smothering the warnings for now, with some open housekeeping tickets to clean up the code once the problems have been resolved upstream. |
- python-dateutil uses the deprecated datetime.utcfromtimestamp(); its next release after 2.8.2 will no longer use this function. - Missing coverage is being falsely reported for an exit from a finally block; the coverage exclusion can be removed with python/cpython#105658.
2f1460c
to
fc7f648
Compare
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.
/me sheds at tear at the beauty... :-)
Changes
Notes
DeprecationWarning
from pytest forast
constantsDeprecationWarning
from dateutil fordatetime.utcfromtimestamp()
usagePR Checklist: