Skip to content
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

Cannot globally set Import Strategy #581

Open
julianstirling opened this issue Nov 29, 2024 · 1 comment
Open

Cannot globally set Import Strategy #581

julianstirling opened this issue Nov 29, 2024 · 1 comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers help wanted Issues identified as good community contribution opportunities needs PR

Comments

@julianstirling
Copy link

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): Varies, mostly 3.10 or 3.12
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): vitrualenv
  • Operating system (and version): Kubuntu 24.04
  • Version of tool extension you are using: v2024.0.0

Behaviour

Expected Behavior

  • Packages installed in this virtualenv available to PyLint
  • Setting a Import Strategy at user level would apply to all projects

Actual Behavior

  • PyLint doesn't find certain packages. I think these are mostly ones that are installed with pip install -e, but may also be other packages in the current environment. This leads to lots of linting errors.
  • The linting errors go away if Import Strategy is set to fromEnvironment for the Workspace.
  • If Import Strategy is set to fromEnvironment for User settings. I would expect this to apply to all workspaces where this setting is not set? However, every workspace needs manually setting to fromEnvironment.

Reproduction Steps:

  • Create a virtual environment for a project.
  • Install the project with pip install -e .
  • Open in VSCode
  • Let pylint run on a file the imports from the project.

Logs:

I haven't taken any logs. Please let me know if they would be helpful

Outcome When Attempting Debugging Steps:

Did running it from the command line work? Pylint works fine from command line or if "fromEnvironment" is set.

Extra Details

Not that I can think of.

@julianstirling julianstirling added the bug Issue identified by VS Code Team member as probable bug label Nov 29, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Nov 29, 2024
@karthiknadig karthiknadig added good first issue Good for newcomers needs PR help wanted Issues identified as good community contribution opportunities and removed triage-needed Issue is not triaged. labels Dec 2, 2024
@karthiknadig
Copy link
Member

This should be easy enough to fix, we are open to taking a PR on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers help wanted Issues identified as good community contribution opportunities needs PR
Projects
None yet
Development

No branches or pull requests

2 participants