pytest-flake8
pytest-flake8 copied to clipboard
flake8 5 breaks plugin no attribute ConfigFileFinder
Setuptools tests have started failing in the pytest-flake8 plugin:
AttributeError: module 'flake8.options.config' has no attribute 'ConfigFileFinder'
I'm having the same problem
This is affecting us as well, copying the same fix as others.
https://github.com/sscpac/statick
I had the same problem with versions 5.0.0 and up of flake8
. FWIW, some of the pytest devs now consider using flake8
within pytest
to be an anti-pattern, and prefer doing flake8
/black
/etc. checks using pre-commit
: https://github.com/pytest-dev/pytest/issues/9217#issuecomment-965144375
we're seeing the same behaviour with flake8==5.0.4
- incidentally I saw some fellow opened an issue on the flake8 GH repo https://github.com/PyCQA/flake8/issues/1652 that got immediately closed - not sure what the dev that closed that issue was on about and frankly I wish he was a bit nicer too :grin:
@valeriupredoi flake8 had a public API that we're committed to not breaking but this plugin does not use that and instead is accessing things only intended for use by Flake8. If people won't develop against the API, and then their tooling breaks, that's not a big in flake8. Hence why it was closed. Did you read the comments on the issue you found?
@sigmavirus24 that makes sense! I did - and I wanted to find a comment like yours, and with a bit more context too, and a possible solution too, not a terse snap of a comment - I like it when people learn stuff, helped by the ones that know what the problem is :smiley: Also, it's none of our faults that flake8>5
is breaking, flake8
and pytest-flake8
should get their affairs in order for happy users :grin:
I'm a Flake8 maintainer. I've tried to help this plugin to the right thing and been ignored. Flake8 bears no further responsibility here and you telling me that we do is a shitty way to behave. Read the license of Flake8. We already go above and beyond that but it's apparently not enough? I have tried to help but that's not enough? You decide you have the right to demand more of our time helping a project that the pytest devs don't condone, that had ignored offers of help to do the right thing? That sucks and that's the attitude burning people out
@sigmavirus24 I am very sorry to hear that - and that exposes a few issues I've seen around here (the Python packages ecosystem, not here-here) - being ignored or not having a healthy collaboration with the groups that actually are related to your project - not to mention the feedstock maintainers that don't communicate with the package devs or vice-versa - I feel your pain. Regardless, note that I didn't demand anything, I was just hoping for a nicer, more informative comment, like we all should try to provide on GitHub, and I know it's a bit more time-consuming, but it goes a long way: e.g. if your colleague wasn't such a buzz-kill and shut off that issue (literally, by locking it) and wrote only two more lines a la "pytest-flake8 is causing the issues, I recommend pinning flake8 for now until we/they sort out the issues" and maybe post a link for a relevant, open issue you wouldn't have to waste your time writing comments here. Having said this, cheers for the explanation about the problems flake8 is having with pytest_flake8, we'll rethink the use of the plugin :+1:
Except that the issue you commented on was a duplicate linked (if I remember correctly to the duplicate which had greater detail), so there was already greater detail available already.
Also you said
Also, it's none of our faults that flake8>5 is breaking, flake8 and pytest-flake8 should get their affairs in order for happy users 😁
Implying that Flake8 shared blame here and "should" do something else. That's what I'm reacting to. The idea that we should do something else. The idea anyone should do anything is in excess of what the project guarantees in the license. Your choice of language is shame-y which leads to burnout.
sorry, mate, nowhere on https://github.com/PyCQA/flake8/issues/1652 does it say it's a duplicate of anything - the only label is Invalid; alas, my apologies for the choice of words, but a nice and polite pointer to the License would have sorted this out; don't expect newcomers to the repo to have read the license, also do expect newcomers to the repo to assume that flake8
is somehow well related to pytest-flake8
- I get your frustration from the plugin vs package set of conflicts (now that you told me about them, I've actually initiated the move to move away from pytest-flake8 in our project thanks to info from you, cheers!) but please be patient with people posting on your GH repo - again, coming back to being a bit nicer and accommodating - we're Europeans, we demand politeness :grin: :grin:
You demand politeness but politeness would be searching an issue tracker for your issue. You found one closed issue with the exception related to a different tool accessing internals but not the 2+ others?
Further there isn't a single open source license that guarantees your right to demand anything. You do have the right to use without any implicit warranty, right to redistribute and right to modify but that is pretty much the basics. Some licenses have other things like patent/intellectual property protections and copyright assignment etc but there's no guarantee that a developer has to respond to you, repair a bug, or provide you free support (technical, or in this case, emotional).
I've worked with tonnes of Europeans all of whom understood this. I don't think that is a valid excuse for being impolite. If you're going to demand politeness, learn to show it yourself first. Kindness begets kindness.
@sigmavirus24 mate, like I said above, I don't demand, oh sorry - demand - anything, all I was saying was:
- it would have been nice if your colleague didn't shut the door both to the OP and to myself in https://github.com/PyCQA/flake8/issues/1652 and provided some sort of minimal guidance, or to the very least, a link to the other issue(s) where this was discussed; let me emphasize - it would have been nice - most other devels do this and this is how you gain popularity for your package - be nice to users and provide decent support;
- it would have been nice if you didn't lecture me on licenses and patents and stuff that shows you like your bureaucracy but have very little sense about supporting the regular Joe that comes along and asks a question, or thinks, wrongly in this case, that
pytest-flake8
issues should be looked at also byflake8
devels - I mean - who would have thought these are completely unrelated entities? I'm supposed to read the License agreement, I know, my apologies; - it would have been nice if you didn't say I need emotional support - ha! - your kind of person would be the last one I'd go for emotional support - I don't even know you - this was all about suggesting a nicer user support would go a long way. However, I expect - yes, this time around, I demand professional communication around here, because this is the norm on GitHub - courteous, professional communication; it looks like you don't really do that, so am gonna be frank myself in this case too: lose the ego, mate, otherwise you'll be hated by everyone who works with you or for you (which is probably the case anyway) :beer:
I must apologize to the other fellas around on this open issue for this sort of back and forth, it is neither professional nor pertinent to the issue at hand, but it looks like some people are simply unable to admit they, and their project, and their employees/colleagues can improve. @sigmavirus24 I suggest we wrap this up, and if you would still want to go on, please feel free to contact me at my work email [email protected] Cheers!
This issue becomes even more pressing now that importlib_metadata
5 no longer supports the deprecated interfaces used by flake8
4.x. Later versions of flake8 do seem to support it.
I had the same problem with versions 5.0.0 and up of
flake8
. FWIW, some of the pytest devs now consider usingflake8
withinpytest
to be an anti-pattern, and prefer doingflake8
/black
/etc. checks usingpre-commit
: pytest-dev/pytest#9217 (comment)
See https://github.com/jaraco/skeleton/issues/48 why that recommendation leads to unnecessary complexity and a degraded experience.
See https://github.com/jaraco/skeleton/issues/48 why that recommendation leads to unnecessary complexity and a degraded experience.
Interesting, thanks. In our case we were already doing flake8
and black
checks in both pre-commit
and pytest
on the CI, so removing them from pytest
actually reduced complexity. I haven't noticed any major downsides since making the change. But depending on your setup, of course, YMMV.
This issue means pytest-flake8 is unusable on Python 3.12, as flake8<5 is incompatible with Python 3.12. Are there any plans to fix it?
Help!!!
I see that this project was almost abandoned earlier this year and even had a PEP 541 request (https://github.com/pypa/pypi-support/issues/1584) to hand off ownership. I'm going to file a separate issue about general project maintenance and explore options there.
Help!!!
use flake8
(and call it with eg flake8 -n 4
for CircleCI or flake8 -n 2
for Github Actions, the recommended numbers of processes differ between platforms) and remove pytest-flake8
from your environment; we've done that (and even unpinned flake8 from flake8 <5
while we were using the plugin) and all works fine :+1: