From e6ae03d96d769eed9a0f38bd6f692e9afe21c3f3 Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Wed, 29 Nov 2023 10:10:40 -0500 Subject: [PATCH 1/2] precommit: ugprade flake8 to latest v6.1.0 The previous 4.0.1 version of flake8 now hits the following error due to importlib-metadata >= 5.0.0 removing compatibility shims for deprecated entry point interfaces: AttributeError: 'EntryPoints' object has no attribute 'get' See: https://importlib-metadata.readthedocs.io/en/latest/history.html#v5-0-0 Upgrading to the latest version should get around these issues with newer importlib-metadata version. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9987645..a15630f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: exclude: .*/tests/.* - repo: https://github.com/pycqa/flake8 - rev: '4.0.1' + rev: '6.1.0' hooks: - id: flake8 args: From 155a224de9376b90cb9fcde6350f8380c976bb38 Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Wed, 29 Nov 2023 10:22:37 -0500 Subject: [PATCH 2/2] flake8 is stricter now on format string variables --- apps/regapp/views/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/regapp/views/utils.py b/apps/regapp/views/utils.py index 699f05a..1f1bfe7 100644 --- a/apps/regapp/views/utils.py +++ b/apps/regapp/views/utils.py @@ -81,7 +81,7 @@ def get_user_confirmation(account_action, validation_email): # This should not happen... errmsg = ( "Account action has unrecognized " - f"opcode { account_action.opcode }" + f"opcode {account_action.opcode}" ) logger.error(errmsg) raise RuntimeError(errmsg)