-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add VIRTUENV_BIN
to the list of supported predefined variables to resolve linter settings
#92
Comments
@jnoortheen Can you try |
Yes it is working if I launch it from terminal after setting the environment variable. But it would be nice to have a variable pointing to the current venv path selected from the Python extension automatically. |
That is a bit odd. Does vscode-python special-case the name "flake8" or something? Shouldn't it just look it up on the path regardless... I think I encountered a similar issue trying to configure |
@karthiknadig Do you need any other info? |
@jnoortheen We have all the information we need. We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision. @DylanYoung Can you file a separate bug for the issue? @karrtikr Does |
Unfortunately no, command variables are only supported for VSCode doesn't automatically resolve command variables when we fetch settings using API, and probably can't as launching commands is an async operation but fetching settings is not. (Opened feature request microsoft/vscode#102414 to confirm) |
It's not a separate issue, lol. It just doesn't look in PATH, same as this issue (since VENV should be in PATH). |
@DylanYoung There are two things. 1) Accessing a relative location based on the selected interpreter. 2) Running tools in an activated environment. In your case we should be running flake8 from an activated environment. We should not be searching PATH for flake8. Calling flake8 should run the the binary/script they have under /scripts directory. The fact that we are not running from linter from an activated environment is a separate issue. |
any update on this? with settings: and with environment activated and the binary present in /scripts director, vscode complains saying flake8 is not installed. |
I have to disagree, though perhaps I'm missing something about the design. If you're skipping my path, then you don't integrate with my dev environment. I have tools that aren't part of my virtualenv that i need to access in my projects. I think you misunderstand as well. Flake 8 (darker/black) isn't in my virtualenv. It's on my PATH. In any case, my only point is that fixing the PATH resolution, fixes a lot of related issues. No one should have to be explicitly selecting their virtualenv to run a tool, as the venv should be the first location in PATH. The feature request here is an X Y problem. |
The premise of this issue states we support a list of predefined variables already, can you name a few we support? I could not find any. Supporting this scenario would require us to resolve Now that we've our own flake8 extension moving this over to https://github.com/microsoft/vscode-flake8 as this will needed to be supported there. Checkout the settings for that extension. |
VIRTUENV_BIN
to the list of supported predefined variables to resolve linter settings
I am using
flakehell
as the runner forflake8
. I am able to configure it usingBut I had to give the full path. It would be nice to have this variable to the list of predefined-variables. So it will work with different venvs and no need to change it every time.
So the above setting can be simplified like
The text was updated successfully, but these errors were encountered: