-
Notifications
You must be signed in to change notification settings - Fork 273
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 future annotations #2741
base: develop
Are you sure you want to change the base?
Use future annotations #2741
Conversation
These are no longer part of the ruleset Signed-off-by: Jussi Kukkonen <[email protected]>
This allows using some more nice annotations from 3.10 while still being compatible with even Python 3.8. These are all annotation changes, should not modify any functionality. Signed-off-by: Jussi Kukkonen <[email protected]>
This reverts commit eb6d82f. The change itself was fine but since the code is otherwise compatible with python 3.8, let's revert this to be compatible for one more release. Signed-off-by: Jussi Kukkonen <[email protected]>
aca4a7e
to
687d455
Compare
These are assertions that should happen in production: something is wrong in an unrecoverable way. This is not an API change since no-one should be catching these. Making these AssertionErrors makes them skippable in coverage. Signed-off-by: Jussi Kukkonen <[email protected]>
This makes the results more useful Signed-off-by: Jussi Kukkonen <[email protected]>
c08cafb
to
d89c8e6
Compare
Pull Request Test Coverage Report for Build 12086553417Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Ok, there is now a tiny runtime change as well: Repository module changes an exception type to allow for better coverage management. This is not an API change since the exception is not meant to be caught: it really is an assertion purely for defensive programming purposes. |
We're still compatible with 3.8: let's not force 3.9 yet. Signed-off-by: Jussi Kukkonen <[email protected]>
Thank you @jku |
This PR achieves two things:
X | Y
instead oftyping.Union[X, Y]
,X | None
instead oftyping.Optional[X]
,Almost all changes come from ruff autofixes: there should be no functional changes here. There's a small revert included to avoid the one thing that was incompatible with python 3.8.
This was tested by setting "--python-version 3.8" in our mypy invocation... Ideally we should be linting using the lowest supported python version but I did not include that change in this PR