In order to have code-completion and functioning linting, I'd like VSCode to include a specific path.
https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file
I created a test environment
$ pwd
==> /Users/stephan/saitc/test_ws
$ ls -a
==> . .env tst_pckg
==> .. __init__.py
==> .DS_Store testing.code-workspace
$ cat .env
==> PYTHONPATH="/Users/stephan/saitc"
$ ls tst_pckg/
==> CONST.py __init__.py testing.py
$ cat tst_pckg/CONST.py
==> # -*- coding: utf-8 -*-
==>
==> TEST_CONSTANT = "Test constant's value"
$ cat tst_pckg/testing.py
==> # -*- coding: utf-8 -*-
==>
==> from test_ws.tst_pckg.CONST import TEST_CONSTANT
The setting "python.envFile" is set to "${workspaceFolder}/.env"
With this setup I would expect that VSCode is aware of the package "test_ws" but typing the line:
from test_ws.tst_pckg.CONST import TEST_CONSTANT
in the file "testing.py" gives my no reasonable code completion and "test_ws.tst_pckg.CONST" can not be resolved ("unresolved import"-error in the VSCode ui).
I'm using Anaconda on macos and the Visual Studio Code 1.30.1 which comes with it. Can it be that I have to start visual studio code from the directory "/Users/stephan/saitc/test_ws"? (if so how?)
With every start of Visual Studio Code I'm asked if I want to start the pylint extension. How can I turn this on permanently? (Python›Linting: Pylint Enabled, Python›Linting: Enabled)
Thank you,
Stephan