tholo / pytest-flake8

pytest plugin to run flake8
Other
117 stars 47 forks source link

incompatible with pytest 7.2.0 #92

Open ENM1989 opened 1 year ago

ENM1989 commented 1 year ago

When I run "pytest --flake8" I get the following error: AttributeError: 'Application' object has no attribute 'parse_preliminary_options'

The issue is in the check_file function.

tkutcher commented 1 year ago

Think the problem is actually with flake8 6.0.0. Looks like in the latest commit they actually removed that function from the Application class that pytest-flake8 uses:

See diff at

https://github.com/PyCQA/flake8/commit/0d667a73299971f1cf8ff549c519fffb282b1faf#diff-eb63c667faddfa67b8a2a6e6c3e8a85e34ffca80baddde0f8202e2ece75a52a4L203

Also does not seem to play with flake8 5.0 as it uses a "ConfigFileFinder" class that was removed

For me things work (with many DeprecationWarnings) with pytest 7.2.1, flake8 4.0.1, and pytest-flake8 1.1.1, broken for flake8 >= 5.0

Tiger-zzZ commented 10 months ago

Think the problem is actually with flake8 6.0.0. Looks like in the latest commit they actually removed that function from the Application class that pytest-flake8 uses:

See diff at

PyCQA/flake8@0d667a7#diff-eb63c667faddfa67b8a2a6e6c3e8a85e34ffca80baddde0f8202e2ece75a52a4L203

Also does not seem to play with flake8 5.0 as it uses a "ConfigFileFinder" class that was removed

For me things work (with many DeprecationWarnings) with pytest 7.2.1, flake8 4.0.1, and pytest-flake8 1.1.1, broken for flake8 >= 5.0

Thanks, It's worked for me I run the checks using flake8==6.1.0 and encountered failures, but it passed successfully with version 4.0.1. This is my current environment.

Python 3.10.7
pytest 7.2.0
flake8 4.0.1