-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Add type annotations #603
Add type annotations #603
Commits on Jun 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 04e152f - Browse repository at this point
Copy the full SHA 04e152fView commit details -
Call
Field.get_default()
instead of_get_default()
We can call the inherited public method using `super()` instead of calling the private method directly.
Configuration menu - View commit details
-
Copy full SHA for db93360 - Browse repository at this point
Copy the full SHA db93360View commit details -
Configuration menu - View commit details
-
Copy full SHA for 885da69 - Browse repository at this point
Copy the full SHA 885da69View commit details -
Enable postponed evaluation of annotations for all source modules
This allows using the latest annotation syntax supported by the type checker regardless of the runtime Python version.
Configuration menu - View commit details
-
Copy full SHA for 0043fed - Browse repository at this point
Copy the full SHA 0043fedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 632441e - Browse repository at this point
Copy the full SHA 632441eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56ea527 - Browse repository at this point
Copy the full SHA 56ea527View commit details -
Configuration menu - View commit details
-
Copy full SHA for bde2d8f - Browse repository at this point
Copy the full SHA bde2d8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 172cc72 - Browse repository at this point
Copy the full SHA 172cc72View commit details -
Configuration menu - View commit details
-
Copy full SHA for ebfb345 - Browse repository at this point
Copy the full SHA ebfb345View commit details -
The `Choices` constructor actually only accepts lists and tuples, not arbitrary sequences. However, using `list` in the annotation opens a can of worms related to type variance.
Configuration menu - View commit details
-
Copy full SHA for 2b0b482 - Browse repository at this point
Copy the full SHA 2b0b482View commit details -
Configuration menu - View commit details
-
Copy full SHA for 713a3fe - Browse repository at this point
Copy the full SHA 713a3feView commit details -
Enable postponed evaluation of annotations for all test modules
This allows using the latest annotation syntax supported by the type checker regardless of the runtime Python version.
Configuration menu - View commit details
-
Copy full SHA for aeeb69a - Browse repository at this point
Copy the full SHA aeeb69aView commit details -
Add minimal annotations to unit tests
These annotations are sufficient to pass mypy inspection if mypy is configured to allow unannotated functions.
Configuration menu - View commit details
-
Copy full SHA for 218843d - Browse repository at this point
Copy the full SHA 218843dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23f1811 - Browse repository at this point
Copy the full SHA 23f1811View commit details -
Configuration menu - View commit details
-
Copy full SHA for c83ef89 - Browse repository at this point
Copy the full SHA c83ef89View commit details -
Annotate the
test_choices
moduleThis required a bit of refactoring to get the type of `STATUS` correct for each suite. There are two cases which I decided not to support in the type system: - passing a list instead of a tuple when defining an option group - `in` checks using a data type that doesn't match the choices
Configuration menu - View commit details
-
Copy full SHA for 9d3940a - Browse repository at this point
Copy the full SHA 9d3940aView commit details -
Add pytest to type check dependencies
We also type check the unit tests and the unit tests now import functionality from pytest.
Configuration menu - View commit details
-
Copy full SHA for e4c8810 - Browse repository at this point
Copy the full SHA e4c8810View commit details -
Configuration menu - View commit details
-
Copy full SHA for 949d110 - Browse repository at this point
Copy the full SHA 949d110View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d6cad0 - Browse repository at this point
Copy the full SHA 7d6cad0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecc7312 - Browse repository at this point
Copy the full SHA ecc7312View commit details -
Drop uses of
JoinManager
from the testsThe `JoinManager` class is deprecated and not annotated.
Configuration menu - View commit details
-
Copy full SHA for 3c31423 - Browse repository at this point
Copy the full SHA 3c31423View commit details -
Suppress mypy errors in field tracker tests
I can't find a way to inform mypy of the actual types without duplicating a lot of test code.
Configuration menu - View commit details
-
Copy full SHA for 8f0b4ee - Browse repository at this point
Copy the full SHA 8f0b4eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23a756e - Browse repository at this point
Copy the full SHA 23a756eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f4653f0 - Browse repository at this point
Copy the full SHA f4653f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1db7d6b - Browse repository at this point
Copy the full SHA 1db7d6bView commit details -
Add type argument to
DescriptorWrapper
This preserves the type of the wrapped descriptor (usually a field). Maybe this is overkill, as `DescriptorWrapper` seems to only be used as part of the `FieldTracker` implementation and is not documented and barely tested. But technically, it is public API.
Configuration menu - View commit details
-
Copy full SHA for 0093760 - Browse repository at this point
Copy the full SHA 0093760View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fc37eb - Browse repository at this point
Copy the full SHA 5fc37ebView commit details
Commits on Jun 14, 2024
-
Tell coverage tool to ignore lines intended for mypy only
In particular, `if TYPE_CHECKING:` blocks and `...` in bodies of overloaded method definitions.
Configuration menu - View commit details
-
Copy full SHA for 9dc2247 - Browse repository at this point
Copy the full SHA 9dc2247View commit details