diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5706f2ed..d297dab9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: # Autoformat: Python code - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black @@ -64,7 +64,7 @@ repos: # Lint: Python code - repo: https://github.com/pycqa/flake8 - rev: "6.1.0" + rev: "7.0.0" hooks: - id: flake8 diff --git a/docs/source/how-to/example-oauthenticator.py b/docs/source/how-to/example-oauthenticator.py index 4fd44336..c139ee14 100644 --- a/docs/source/how-to/example-oauthenticator.py +++ b/docs/source/how-to/example-oauthenticator.py @@ -1,6 +1,7 @@ """ Example OAuthenticator to use with My Service """ + from jupyterhub.auth import LocalAuthenticator from oauthenticator.oauth2 import OAuthenticator, OAuthLoginHandler diff --git a/examples/auth_state/jupyterhub_config.py b/examples/auth_state/jupyterhub_config.py index dbb143d3..2852361f 100644 --- a/examples/auth_state/jupyterhub_config.py +++ b/examples/auth_state/jupyterhub_config.py @@ -5,6 +5,7 @@ 2. pass select auth_state to Spawner via environment variables 3. enable auth_state via `JUPYTERHUB_CRYPT_KEY` and `enable_auth_state = True` """ + import os import pprint import warnings diff --git a/oauthenticator/auth0.py b/oauthenticator/auth0.py index 31b2fa27..b9fa2157 100644 --- a/oauthenticator/auth0.py +++ b/oauthenticator/auth0.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with Auth0 as an identity provider. """ + import os from jupyterhub.auth import LocalAuthenticator diff --git a/oauthenticator/azuread.py b/oauthenticator/azuread.py index 48359864..e4e6682b 100644 --- a/oauthenticator/azuread.py +++ b/oauthenticator/azuread.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with Azure AD as an identity provider. """ + import os import jwt diff --git a/oauthenticator/bitbucket.py b/oauthenticator/bitbucket.py index 8221bbfa..6a836f2e 100644 --- a/oauthenticator/bitbucket.py +++ b/oauthenticator/bitbucket.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with Bitbucket as an identity provider. """ + import os from jupyterhub.auth import LocalAuthenticator diff --git a/oauthenticator/cilogon.py b/oauthenticator/cilogon.py index b11739fc..bf08f14e 100644 --- a/oauthenticator/cilogon.py +++ b/oauthenticator/cilogon.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with CILogon as an identity provider. """ + import os from fnmatch import fnmatch from urllib.parse import urlparse diff --git a/oauthenticator/generic.py b/oauthenticator/generic.py index 4dd88bb6..237c7d54 100644 --- a/oauthenticator/generic.py +++ b/oauthenticator/generic.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with any OAuth2 based identity provider. """ + import os from functools import reduce diff --git a/oauthenticator/github.py b/oauthenticator/github.py index 29535e81..fcc63b3b 100644 --- a/oauthenticator/github.py +++ b/oauthenticator/github.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with GitHub as an identity provider. """ + import json import os import warnings diff --git a/oauthenticator/gitlab.py b/oauthenticator/gitlab.py index 1d32fe34..dde71b15 100644 --- a/oauthenticator/gitlab.py +++ b/oauthenticator/gitlab.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with GitLab as an identity provider. """ + import os import warnings from urllib.parse import quote diff --git a/oauthenticator/globus.py b/oauthenticator/globus.py index 1e19a80d..09066e85 100644 --- a/oauthenticator/globus.py +++ b/oauthenticator/globus.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with Globus as an identity provider. """ + import base64 import os import pickle diff --git a/oauthenticator/google.py b/oauthenticator/google.py index 49f506d0..0fad0152 100644 --- a/oauthenticator/google.py +++ b/oauthenticator/google.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with Google as an identity provider. """ + import os from jupyterhub.auth import LocalAuthenticator diff --git a/oauthenticator/mediawiki.py b/oauthenticator/mediawiki.py index ee3c46bd..04677f83 100644 --- a/oauthenticator/mediawiki.py +++ b/oauthenticator/mediawiki.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with MediaWiki as an identity provider. """ + import json import os from asyncio import wrap_future diff --git a/oauthenticator/oauth2.py b/oauthenticator/oauth2.py index 9ba66ecf..60edeb36 100644 --- a/oauthenticator/oauth2.py +++ b/oauthenticator/oauth2.py @@ -3,6 +3,7 @@ Founded based on work by Kyle Kelley (@rgbkrk) """ + import base64 import json import os diff --git a/oauthenticator/openshift.py b/oauthenticator/openshift.py index 599f989f..6b016b0d 100644 --- a/oauthenticator/openshift.py +++ b/oauthenticator/openshift.py @@ -1,6 +1,7 @@ """ A JupyterHub authenticator class for use with OpenShift as an identity provider. """ + import concurrent.futures import json import os diff --git a/oauthenticator/tests/conftest.py b/oauthenticator/tests/conftest.py index 30fe93e0..3ffbdf8c 100644 --- a/oauthenticator/tests/conftest.py +++ b/oauthenticator/tests/conftest.py @@ -1,4 +1,5 @@ """Py.Test fixtures""" + from pytest import fixture from tornado.httpclient import AsyncHTTPClient diff --git a/oauthenticator/tests/mocks.py b/oauthenticator/tests/mocks.py index 83909eb2..f59c537a 100644 --- a/oauthenticator/tests/mocks.py +++ b/oauthenticator/tests/mocks.py @@ -1,4 +1,5 @@ """Mocking utilities for testing""" + import json import os import re diff --git a/oauthenticator/tests/test_azuread.py b/oauthenticator/tests/test_azuread.py index b3537dd5..13be6b0d 100644 --- a/oauthenticator/tests/test_azuread.py +++ b/oauthenticator/tests/test_azuread.py @@ -1,4 +1,5 @@ """test azure ad""" + import json import os import re