-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Environment data
- VS Code version: 1.23.1
- Extension version (available under the Extensions sidebar): 2018.4.0
- OS and version: Linux 4.13.0-41-generic # 46~16.04.1-Ubuntu
- Python version (& distribution if applicable, e.g. Anaconda): python2.7, python3.5, python3.6, others
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): custom (dpkg based)
- Relevant/affected Python packages and their versions: all
Actual behavior
The python extensions uses the currently selected python interpreter to execute linting tools.
Expected behavior
The python extensions uses a different python interpreter to execute linting tools.
This decouples the interpreter used for executing the code from the one used for development tools.
If a different tools python interpreter is not configured the current selected one is used.
Reasons:
The interpreter for the code is likely specific to the project.
The interpreter for the development tools can likely be shared between the projects.
See use case below for more details.
Steps to reproduce:
- Open VScode
- Create a python file
- Select an python interpreter which does not have the linting tools installed
- Get the message "Linter xxx is not installed"
Logs
N/A
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
N/A
Feature Request Use Case
In my current company we use something similar to virtualenv for python projects.
This virtualenv-like environment holds all the dependencies of the projects we currently work, and is stored inside the project folder.
The python extension has the ability to let me pick the python interpreter, and this allows me to point it to this project environment. All of this is good.
The problem is that the python extensions expects to find the linting tools into this environment.
This environment does not have them (since they are not dependencies of the project), and I'm asked to install them.
The environment is regularly reset to remove packages which are not declared dependencies of the project (which makes sense and guarantees that all the dependencies are properly declared).
Adding the linting tools as dependencies would not hold code review as that would mean that they get deployed in production as well.
Having the ability to specify a tools interpreter would allow me to have a virtualenv (or whatever) that holds the linters and the other plugin specific dependencies, while keeping the proper interpreter selected for running code.
Contributing
If provided with some hints of what likely needs to be changed I'm willing to contribute a PR for the feature
Thank you for the extension and all the work that goes into it, it's really good!