-
I'm clearly missing something. My build file and dependencies are recognised. I'm trying to export for my IDE (vscode) but the export produces multiple envs (python-default, tools/black, tools/pylint, etc). What I want is everything in one env where I can point my IDE. I've read the documentation but even that states 'You can specify the --resolve flag multiple times to export multiple virtualenvs at once.' What am I missing? Why would one want to generate multiple different envs. Is there a "trick" to link them somwhow? I think I'm missing some basic understanding which the docs are not providing. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 13 replies
-
#12449 states "This is addressed in a different way by #18481, which allows a tool to be installed from a user resolve.". pull 18481 does not explain what a "user resolve" is. The documentation mentions resolves in various place but I cant find any section that specifcally describes what is meant by "user resolves". I am currently trying to piece together the clues I can find about this concept. |
Beta Was this translation helpful? Give feedback.
-
These don't work:
|
Beta Was this translation helpful? Give feedback.
-
https://www.pantsbuild.org/docs/setting-up-an-ide#tool-virtualenvs states:
Please how for more that 1 tool at a time? |
Beta Was this translation helpful? Give feedback.
-
https://www.pantsbuild.org/docs/python-third-party-dependencies#tool-lockfiles states:
I'm thinking i will try to add the tool locks files as dev dependencies somehow. Where are they? I've run |
Beta Was this translation helpful? Give feedback.
-
I'm try to be too clever for my own good. A solution is to use the PYTHONPATH env variable (vscode settings "python.envFile") to include multiple paths:
after running [end monologue] |
Beta Was this translation helpful? Give feedback.
-
Yeah, potentially the word "resolve" should go away in favor of "lockfile".
…On Sun, Apr 9, 2023, 1:28 PM Paul ***@***.***> wrote:
Thankyou. After multiple reads I just found the sentence I was missing:
"resolves" - logical names given to lockfiles so that they are easy to
reference.
I dont yet understand the need to call "lockfiles names" "resolves". It
would have saved me a lot of suffering if they were just called "lockfile
names. I guess there's reasons for that I am yet to discover.
Thankyou again.
—
Reply to this email directly, view it on GitHub
<#18704 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD5F7D7JB3N3S7WDQUU7ULXAMLVHANCNFSM6AAAAAAWXLS5UQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ive had to remove my answer. It appeared to work at first but since then I've been unable to repeat it. In order to check if linting even works I manually set the pylint path in vscode ( I suspect it has something to do with my python version
I can manually set my tool paths like this but then I have to manually change them all when my python version upgrades. yuck. But I dont know what I can do about vscode/pylint not finding my site-packages? It accepts the environment. Is anybody using this with vscode? How are you doing this? Why is this so damn hard? Surely setting up a dev env is the first thing any newcomer wants to do. |
Beta Was this translation helpful? Give feedback.
-
So I switched to version
set and vscode linting and black formatting is working. "Sort Imports" however is not. Running the fmt goal does however sort the imports. for my sanity's sake I will sort them with the fmt goal for now. I would of course be happy to hear suggestions on how I might get this working in vscode. |
Beta Was this translation helpful? Give feedback.
So I switched to version
2.16.0rc0
and simply added the tools I want (pylint, black, isort) to my requirements.txt andpants generate-lockfiles --resolve=python-default
pants export --py-resolve-format=symlinked_immutable_virtualenv --resolve=python-default
set
dist/export/python/virtualenvs/python-default/3.10.10/bin/python
as Interpreterand vscode linting and black formatting is working. "Sort Imports" however is not. Running the fmt goal does however sort the imports.
for my sanity's sake I will sort them with the fmt goal for now. I would of course be happy to hear suggestions on how I might get this working in vscode.