diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 847c1e3..63d9f06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: # Autoformat: Python code - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black # args are not passed, but see the config in pyproject.toml @@ -48,7 +48,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/examples/jupyterhub_config_lti11.py b/examples/jupyterhub_config_lti11.py index 68f9e9b..3aecf02 100644 --- a/examples/jupyterhub_config_lti11.py +++ b/examples/jupyterhub_config_lti11.py @@ -1,4 +1,5 @@ """ Example JupyterHub configuration file with LTI 1.1 settings. """ + import os # Set port and IP diff --git a/examples/jupyterhub_config_lti13.py b/examples/jupyterhub_config_lti13.py index e4380cf..87ddd4f 100644 --- a/examples/jupyterhub_config_lti13.py +++ b/examples/jupyterhub_config_lti13.py @@ -1,4 +1,5 @@ """ Example JupyterHub configuration file with LTI 1.3 settings. """ + import os # Set port and IP diff --git a/tests/lti13/stash_of_unused_fixtures.py b/tests/lti13/stash_of_unused_fixtures.py index aa11977..b8e71af 100644 --- a/tests/lti13/stash_of_unused_fixtures.py +++ b/tests/lti13/stash_of_unused_fixtures.py @@ -2,6 +2,7 @@ These fixtures are not used but kept as they may be relevant to use in the future. """ + from typing import Any, Callable, Dict import jwt diff --git a/tests/lti13/test_lti13_authenticator.py b/tests/lti13/test_lti13_authenticator.py index 7988ac0..d3f2f2a 100644 --- a/tests/lti13/test_lti13_authenticator.py +++ b/tests/lti13/test_lti13_authenticator.py @@ -5,6 +5,7 @@ We have dedicated tests of LTI13LaunchValidator's methods in test_lti13_validator.py. """ + from unittest.mock import patch import pytest diff --git a/tests/lti13/test_lti13_validator.py b/tests/lti13/test_lti13_validator.py index 7c06bcc..0abb0aa 100644 --- a/tests/lti13/test_lti13_validator.py +++ b/tests/lti13/test_lti13_validator.py @@ -181,9 +181,9 @@ def test_validate_launch_request_empty_roles(launch_req_jwt_decoded): def test_validate_launch_request_invalid_message_type(launch_req_jwt_decoded): validator = LTI13LaunchValidator() - launch_req_jwt_decoded[ - "https://purl.imsglobal.org/spec/lti/claim/message_type" - ] = "???" + launch_req_jwt_decoded["https://purl.imsglobal.org/spec/lti/claim/message_type"] = ( + "???" + ) with pytest.raises(IncorrectValueError): validator.validate_id_token(launch_req_jwt_decoded) @@ -191,9 +191,9 @@ def test_validate_launch_request_invalid_message_type(launch_req_jwt_decoded): def test_validate_launch_request_invalid_version(launch_req_jwt_decoded): validator = LTI13LaunchValidator() - launch_req_jwt_decoded[ - "https://purl.imsglobal.org/spec/lti/claim/version" - ] = "1.0.0" + launch_req_jwt_decoded["https://purl.imsglobal.org/spec/lti/claim/version"] = ( + "1.0.0" + ) with pytest.raises(IncorrectValueError): validator.validate_id_token(launch_req_jwt_decoded)