flake8-nb
flake8-nb copied to clipboard
[BUG] Freshly installed flake8_nb won't properly start
Describe the bug
I just run flake8_nb from the CLI and the following error message shows up:
Traceback (most recent call last): File "/home/runner/.local/bin/flake8_nb", line 8, in <module> sys.exit(main()) File "/home/runner/.local/lib/python3.8/site-packages/flake8_nb/__main__.py", line 30, in main app = Flake8NbApplication() File "/home/runner/.local/lib/python3.8/site-packages/flake8_nb/flake8_integration/cli.py", line 78, in __init__ super().__init__(program, version) TypeError: __init__() takes 1 positional argument but 3 were given
There seems to be an issue with the dependencies, because this is what pip showed me:
2022-08-01T09:21:01.3609612Z INFO: pip is looking at multiple versions of flake8-nb to determine which version is compatible with other requirements. This could take a while.
2022-08-01T09:21:01.3669041Z Collecting flake8_nb
2022-08-01T09:21:01.3761741Z Downloading flake8_nb-0.3.1-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.4176481Z Downloading flake8_nb-0.3.0-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.4629941Z Downloading flake8_nb-0.2.7-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.5077060Z Downloading flake8_nb-0.2.6-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.5519271Z Downloading flake8_nb-0.2.5-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.5935728Z Downloading flake8_nb-0.2.4-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.6288193Z Downloading flake8_nb-0.2.3-py3-none-any.whl (22 kB)
2022-08-01T09:21:01.6570612Z INFO: pip is looking at multiple versions of flake8-nb to determine which version is compatible with other requirements. This could take a while.
2022-08-01T09:21:01.6749410Z Downloading flake8_nb-0.2.1-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.7085630Z Downloading flake8_nb-0.2.0-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.7450504Z Downloading flake8_nb-0.1.8-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.7788708Z Downloading flake8_nb-0.1.7-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.8233164Z Downloading flake8_nb-0.1.6-py3-none-any.whl (21 kB)
2022-08-01T09:21:01.8482448Z INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
Are you aware of any dependency issue that might cause this behavior?
To Reproduce Steps to reproduce the behavior:
- Setup github workflow without a fixed version
- Run
flake8_nb
from CLI - See error
Expected behavior flake8_nb should run like it has done in the past and pip should install the latest version. Thanks for the project, it does help me a lot!
Looks like this is an issue with flake8>=5.0.0 which was released 2 days ago. Since flake8-nb uses flake8 internals which aren't part of the public API the upper version of flake8 is pinned to a version that is tested to work. https://github.com/s-weigand/flake8-nb/blob/8dcf4455fe9552f25c45a17da59e2ef72f4f9e13/setup.cfg#L41
If your code or one of your dependencies requires a newer version of flake8 this will lead to the dependency resolving issue with pip you saw.
When I got time I will work on flake8>5.0.0 compatibility.
Is your project public so I can have a look at the dependencies in question and help with a temporary workaround?
@all-contributors please add @1kastner for bug
Thanks @s-weigand for the fast answer. The project is available at https://github.com/1kastner/conflowgen. After having pinned it to flake8_nb >=0.4
, it seems to work again. Some logs are available at https://github.com/1kastner/conflowgen/runs/7609578157?check_suite_focus=true.
I guess with the unpinned versions pip first installed flake8==5.0.1
and after that checked which version of flake8-nb
would be compatible with it, which at that point was none.
With flake8_nb >=0.4
the priority order might be different and since flake8
is a dependency of flake8-nb
the requirement is already fulfilled.
Great, then I have a fix for the meantime and I am looking forward to the new version with flake8>5.0.0 compability you mentioned! Thank you very much for the fast and insightful diagnosis!
Should be resolved in #240