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

added flake8-type-checking #513

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cylc/uiserver/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
)

from cylc.uiserver.authorise import Authorization, AuthorizationMiddleware
from cylc.uiserver.resolvers import Resolvers
from cylc.uiserver.websockets import authenticated as websockets_authenticated
from cylc.uiserver.websockets.tornado import TornadoSubscriptionServer

if TYPE_CHECKING:
from cylc.uiserver.resolvers import Resolvers
from cylc.uiserver.websockets.tornado import TornadoSubscriptionServer
from graphql.execution import ExecutionResult


Expand Down Expand Up @@ -97,7 +98,7 @@ def is_token_authenticated(handler: 'CylcAppHandler') -> bool:
In these cases the bearer of the token is awarded full privileges.
"""
identity_provider: JPSIdentityProvider = (
handler.serverapp.identity_provider
handler.serverapp.identity_provider # type: ignore[union-attr]
)
return identity_provider.__class__ == PasswordIdentityProvider
# NOTE: not using isinstance to narrow this down to just the one class
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ explicit_package_bases = True
allow_redefinition = True
strict_equality = True
show_error_codes = True

# Suppress the following messages:
# By default the bodies of untyped functions are not checked, consider using --check-untyped-defs
disable_error_code = annotation-unchecked
Copy link
Member

Choose a reason for hiding this comment

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

(This is not strictly needed as those messages are informational and don't fail the check)

1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ tests =
flake8-debugger>=4.0.0
flake8-mutable>=1.2.0
flake8-simplify>=0.14.0
flake8-type-checking
flake8>=3.0.0
jupyter_server[test]
mypy>=0.900
Expand Down
Loading