[arch-general] [arch-gen][flake8] flake8.main.git module no longer available on flake8 v. 1:4.0.1-1, breaking pre-commit flake8 hooks
Today I upgraded the system, and got a new flake8 version:
[2021-11-03T02:29:18-0600] [ALPM] upgraded flake8 (1:3.9.2-2 -> 1:4.0.1-1)
However that version no longer provides the flake8.main.git module, therefore now I get a failure when trying to commit something (using the flake8 pre-commit hook the work project uses):
% git ci --amend INFO | Running hook pre-commit.d/02-check_flake8... ERROR | Traceback (most recent call last): File "/home/vasqueja/scm/hpe/git/provision-sdk/.git/hooks/pre-commit.d/02-check_flake8", line 25, in <module> from flake8.main.git import (config_for, update_excludes, ModuleNotFoundError: No module named 'flake8.main.git' ERROR | Hook pre-commit.d/02-check_flake8 failed. Aborting...
Is there a way to overcome this? Is there sort of a new packet covering for that functionality? I don't see any new optional dependency which might have covered for the missing module:
Depends On : python-pyflakes python-mccabe python-pycodestyle python-entrypoints Optional Deps : None Required By : python-flake8-polyfill
Thanks ! -- Javier
What git --version are you using and how do you setup your pre-hook? According to the code changelog [1] this "functionality" was removed but never added back in [1]. But they do support git hooks [2] in a different way perhaps. [1] https://github.com/PyCQA/flake8/compare/c6e0d27...82b698e [2] https://flake8.pycqa.org/en/latest/user/using-hooks.html Best wishes: Anton Hvornum On Thu, Nov 4, 2021 at 6:29 AM Javier via arch-general <arch-general@lists.archlinux.org> wrote:
Today I upgraded the system, and got a new flake8 version:
[2021-11-03T02:29:18-0600] [ALPM] upgraded flake8 (1:3.9.2-2 -> 1:4.0.1-1)
However that version no longer provides the flake8.main.git module, therefore now I get a failure when trying to commit something (using the flake8 pre-commit hook the work project uses):
% git ci --amend INFO | Running hook pre-commit.d/02-check_flake8... ERROR | Traceback (most recent call last): File "/home/vasqueja/scm/hpe/git/provision-sdk/.git/hooks/pre-commit.d/02-check_flake8", line 25, in <module> from flake8.main.git import (config_for, update_excludes, ModuleNotFoundError: No module named 'flake8.main.git' ERROR | Hook pre-commit.d/02-check_flake8 failed. Aborting...
Is there a way to overcome this? Is there sort of a new packet covering for that functionality? I don't see any new optional dependency which might have covered for the missing module:
Depends On : python-pyflakes python-mccabe python-pycodestyle python-entrypoints Optional Deps : None Required By : python-flake8-polyfill
Thanks !
-- Javier
On 11/4/21 02:53, Anton Hvornum via arch-general wrote:
What git --version are you using and how do you setup your pre-hook?
% git --version git version 2.33.1
According to the code changelog [1] this "functionality" was removed but never added back in [1].
Oh, you're right, I missed that when looking into the commits referenced by the released notes milestones [3], because I though of *cvx* (concurrent versions system), instead of the right *vcs*, hahaha. Ohh my, our work project still uses the old hooks, and they are not using *python-pre-commit*, :(
But they do support git hooks [2] in a different way perhaps.
Ohh my, our work project still uses the old hooks, and they are not using *python-pre-commit*, :( I'll have to see how I can commit, without having to always be under a docker image... Thanks a lot ! -- Javier [1] https://github.com/PyCQA/flake8/compare/c6e0d27...82b698e [2] https://flake8.pycqa.org/en/latest/user/using-hooks.html [3] https://github.com/PyCQA/flake8/milestone/39?closed=1
participants (2)
-
Anton Hvornum
-
Javier