-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
User-installed flake8 is using system-level pycodestyle dependency and crashing #1385
Comments
that's just how user installs work -- your local site-packages and the system site-packages are both available use a virtualenv |
@asottile It should prioritize using the user-installed version of |
it does, but they're both available so they both get loaded |
@BTOdell also, how exactly do you expect Flake8 itself to isolate itself from the system? It's not possible. We rely on external libraries to find the installations and they have no means of distinguishing between the two either. As @asottile has said, use a virtualenv. If you don't want to configure that yourself, you can use a tool like |
I expect flake8 to load and use the correct version of I have other linting tools installed in this same way. They have dependencies too and they load the correct user-installed versions. Why can't flake8? |
Python searches
Is flake8 not using standard Python importing? |
We do use it Line 5 in 03401a6
|
It's also condescending, bordering on hostile, to insist that the maintainers of a widely used package who have a combined over 2 decades of experience with this don't know what we're doing when we provide you with the exact explanation of the problem as well as a solution. |
I am using You haven't provided an "exact explanation" at all. In fact, you've provided conflicting answers. You said before that you are using "external libraries" to find the installations and now you say you're using the standard, built-in I'm being persistent because you're being dismissive of this problem and there is a chance that you're not understanding what my expectation is. I don't know how the expectation of a tool importing it's dependencies correctly is unreasonable. From the stack trace, it seems like the crash is originating from your (dare I say) home-brew plugin manager. If the |
enough. |
To wrap this up
User-installed packages are an occasionally okay way to install things which is why the PyPA - the folks behind User-installed packages also presume you're not going to try to have multiple copies (system-level and user-level). The fact that this sometimes works is almost certainly undefined behaviour.
No. You just haven't done enough to understand the underlying mechanisms at play. We've used
It's unreasonable when the behaviour is that of the standard library.
Which provides logic around the standard library to make our lives simpler. It's a convenience layer for the rest of the application which you might know if you'd looked at the maintainer docs or read up on
At the very least it's loading the standard library first. It may be loading both simultaneously but it's not behaviour we can anticipate nor is the added complexity of fixing "One hostile user complained about this" worth the effort or the maintenance cost when the authorities have built better ways of doing what you want which when used get you exactly the behaviour you want. But I'm guessing you didn't bother reading the docs that I found and linked for you or understanding how those tools better suit your needs. |
Please describe how you installed Flake8
Flake8 is installed at the system-level by administrator on Ubuntu 18.04:
Then, a user (jenkins) installs a newer version of flake8 (3.9.2) to their user directory:
Please provide the exact, unmodified output of
flake8 --bug-report
Please describe the problem or feature
It seems like flake8 is importing the system-level
pycodestyle
package instead of the user-levelpycodestyle
package.If the system-level flake8 package is uninstalled and all dependencies (inc. pycodestyle) are removed, then the user-level flake8 starts working.
Perhaps a bug in flake8's plugin resolution order?
The text was updated successfully, but these errors were encountered: