Hi there, are there any instructions on setting up...
# general
p
Hi there, are there any instructions on setting up IDE intellisense for a Python repo managed by Pants? Our developers typically use vscode and PyCharm. Thanks
b
There's this page in the docs. https://www.pantsbuild.org/docs/setting-up-an-ide Do let us know if your devs runs into any difficulties.
👍 3
p
Worked for me!
🙌 1
f
For VSCode: By default, the VSCode Python extension looks for and loads a file named 
.env
 in the current workspace folder. For your convenience, this file can be part of the repository so that VSCode can understand where to look for sources when working in a monorepo consisting of multiple Python projects. It adjusts the 
PYTHONPATH
 (https://code.visualstudio.com/docs/python/environments#_use-of-the-pythonpath-variable) variable adding all projects in the monorepo. Having this file makes it possible to jump to definition in the source code across multiple projects. It also makes the cross-projects refactoring possible. Set 
python.venvPath
 in the application settings to point to the virtual environment created earlier (https://www.pantsbuild.org/docs/setting-up-an-ide#third-party-dependencies). The Python interpreter in the virtual environment you’ve specified will be used to run all Python applications in the VSCode workspace.
For PyCharm: If you are new to PyCharm, see Get started tutorial. • Configure the Python interpreter to point to the 
python
 executable in the virtual environment created earlier. See Configure a virtual environment to learn more. • Mark all directories within the project as 
Sources Root
 (can be done in batch by selecting multiple directories). Doing this will let you jump to definition in the source code and will make the cross-projects refactoring possible.
--- These are the instructions that work for our users 🙂
🌈 2
👍 2
p
Thanks a lot Alexey!