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

Fully enable mypy for web package #661

Merged
merged 8 commits into from
Aug 17, 2023
Merged

Fully enable mypy for web package #661

merged 8 commits into from
Aug 17, 2023

Conversation

lukasjuhrich
Copy link
Collaborator

@lukasjuhrich lukasjuhrich commented Aug 17, 2023

Refs #559

This fixes a type admonition, because we set a value to a `dict`
instead of an `OrderedDict`
This causes the type hint to be more correct; since `ABC` does not
support abstract class attributes, we implement the check ourselves
using the `__init_subclass__` hook.
This includes
- using 2.0-style select instead of `Query`
- using explicit `bool` conversion for functions returning
  `bool` (short circuiting can cause either element of a boolean clause
  to be returned as-is)
- some type hints are added / weakened / strengthened / fixed appropriately
This is cleaner than just dynamically setting attributes on `Subnet`.
@@ -56,6 +52,7 @@ module = [
"web.blueprints",
"web.blueprints.access",
"web.blueprints.facilities",
# "web.blueprints.host",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That should be reverted, but I am lazy and we want to look at enabling stricter rules for most modules, anyway

@lukasjuhrich lukasjuhrich merged commit 4ec9170 into develop Aug 17, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant