Open wgottwald opened 1 year ago
This was solved by calling
pre-commit autoupdate
as suggested here.
This changed the .pre-commit-config.yaml file.
Now there seem to be issues with flake8 when tryin to commit:
check docstring is first.................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
black....................................................................Passed
isort....................................................................Passed
nbqa-black...............................................................Passed
nbqa-isort...............................................................Passed
nbstripout...............................................................Passed
prettier.................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
Traceback (most recent call last):
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/bin/flake8", line 8, in <module>
sys.exit(main())
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
app.run(argv)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
self._run(argv)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
self.initialize(argv)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
self.plugins, self.options = parse_args(argv)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/options/parse_args.py", line 51, in parse_args
option_manager.register_plugins(plugins)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/options/manager.py", line 259, in register_plugins
add_options(self)
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8_typing_imports.py", line 529, in add_options
option_manager.add_option(
File "/Users/wolfganggottwald/.cache/pre-commit/reposl_opoad/py_env-default/lib/python3.10/site-packages/flake8/options/manager.py", line 281, in add_option
self._current_group.add_argument(*option_args, **option_kwargs)
File "/Users/wolfganggottwald/opt/anaconda3/envs/mpl-interactions/lib/python3.10/argparse.py", line 1428, in add_argument
raise ValueError('%r is not callable' % (type_func,))
ValueError: 'str' is not callable
autoflake................................................................Passed
It seems that there exists a newer version of flake8-typing-imports: here.
Therefore I edited the .pre-commit-config.yaml file:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.12.0]
Which fixed the issue.
Sorry for not responding I was away all weekend and blissfully never opened my laptop :).
This is probably a good moment for me to look over the config and do things like switching to ruff
I thought so, makes sense 😃👍🏻
I forked mpl-interactions, then made a branch for a new feature there and tried to commit my changes to that branch. However it does not work and I get the following error message: Looks like it has something to do with the pre-commit? I tried searching around for this but could not find a reasonable answer. Does someone have an idea?