-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it compatible with latest flake8 #96
base: master
Are you sure you want to change the base?
Conversation
from this 1346ddefd315223b8f476bb02381a944e14f2cbc the semantic was to only allow errorcode
config_finder = config.ConfigFileFinder( | ||
app.program, | ||
prelim_opts.append_config, | ||
config_file=prelim_opts.config, | ||
ignore_config_files=prelim_opts.isolated, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #88 the code is kept 🤔 but from the commit where they change they remove it.
if flake8ignore: | ||
app.options.ignore = flake8ignore | ||
app.make_formatter() # fix this | ||
app.make_guide() | ||
app.make_file_checker_manager() | ||
app.make_file_checker_manager([]) | ||
app.run_checks([str(path)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, correct me if I'm wrong because I'm not an expert. I am wondering how you know that run_checks()
needs that one argument ([str(path)]
), because in run_checks() is not other argument than self
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I might have a wrong setup will retry
I've tested this PR and looks like pytest still fails Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-flake8-1.1.1-7.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-flake8-1.1.1-7.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-flake8-1.1.1
configfile: tox.ini
plugins: flake8-1.1.1, benchmark-4.0.0, aspectlib-2.0.0
collected 16 items
pytest_flake8.py F [ 6%]
setup.py F [ 12%]
test_flake8.py F..FFFF.FFF.xF [100%]
[..]
================================================================================== short test summary info ==================================================================================
XFAIL test_flake8.py::test_strict - flake8 is not properly registered as a marker
FAILED pytest_flake8.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options'
FAILED setup.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options'
FAILED test_flake8.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_options'
FAILED test_flake8.py::TestIgnores::test_default_flake8_ignores - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_flake8.py::TestIgnores::test_ignores_all - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_flake8.py::TestIgnores::test_w293w292 - Failed: nomatch: '*W293*'
FAILED test_flake8.py::TestIgnores::test_mtime_caching - Failed: nomatch: '*W293*'
FAILED test_flake8.py::test_ok_verbose - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_flake8.py::test_keyword_match - Failed: nomatch: '*E201*'
FAILED test_flake8.py::test_run_on_init_file - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_flake8.py::test_junit_classname - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
========================================================================== 11 failed, 4 passed, 1 xfailed in 3.18s ========================================================================== Please let me know if you need full pytest output. |
I did the PR when latest pytest was 7.2.0 Have you tested with this version ? Or your tested with 8.1.1 ? At the time of my PR it allowed to have a more recent range of dependencies but maybe it need another PR to target latest (would prefer to have it merged if it improve the current status and maybe I will do another PR) |
Nope. I've tested that using latest pytest 8.1.1 😋 |
As part of the works for the next Ubuntu Noble version under https://bugs.launchpad.net/ubuntu/+source/python-pytest-flake8/+bug/2058914 my teammate @clalancette made a path that I've verified can work with:
Patch against 1.1.1 is at 1.1.1...clalancette:pytest-flake8:modern-flake8 |
Please consider contributing this fix or others to the revived project at coherent-oss. |
Fix #92 This make test passes. The modification was small and I have done atomic commit to explain the fix.