https://pantsbuild.org/ logo
m

modern-stone-88910

07/06/2022, 7:58 AM
Hello there, I’m using pants with a VSCode devcontainer. Now I’m trying to access Pylint, MyPy, Black etc. from VSCode UI, so that e.g.
Python: Run Linting
from the Command Palette works, or
Format Document
when right-clicking in the workspace. I’ve kind of got this working by adding following lines into the devcontainer.json -> "settings" after exporting the virtualenv with those tools through pants export:
Copy code
"python.defaultInterpreterPath": "./dist/export/python/virtualenvs/default/3.8.13/bin/python",

"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.blackEnabled": true,
"python.formatting.provider": "black",
"python.linting.pylintPath": "./dist/export/python/virtualenvs/tools/pylint/bin/pylint",
"python.linting.mypyPath": "./dist/export/python/virtualenvs/tools/mypy/bin/mypy",
"python.formatting.blackPath": "./dist/export/python/virtualenvs/tools/black/bin/black",
From previous experimenting with pants I know I got this working without having to define paths for each tool. Sadly, I forgot what I did then. What do I miss? Having to manually point each tool into one path seems prone to errors when using multiple environments. I need a way that VSCode gets a path to the virtualenvs-directory etc, so that the paths are automatically identified. Thanks for your help.
b

busy-vase-39202

07/12/2022, 4:31 PM
Hi @modern-stone-88910. Sorry you haven't gotten a reply to this. Usually we are more responsive. Unfortunately, I think we don't have anyone with requisite devcontainers experience. My apologies. :-(
h

happy-kitchen-89482

07/12/2022, 5:47 PM
Hi, sorry, unfortunately I don't think we have any VSCode users in the core maintainers group at least
I have been meaning to start using it, since a lot of our users do
m

modern-stone-88910

07/13/2022, 7:52 AM
No problem, thanks for the respone :)
4 Views