Another noob question: how do I make my code edito...
# general
b
Another noob question: how do I make my code editor aware of the third party libraries? Such as if I use FastAPI and import it, the code editor doesn't recognize that (because I only have it setup to look for a virtual environment).
w
Have you tried out exporting the tools to a venv? https://www.pantsbuild.org/2.20/reference/goals/export
b
Oh, I didn't know about that. Thanks!
šŸ‘ 1
I don't understand what to add to the
resolves
section in the config. Any guidance?
I think I found how here: āÆ pants export --py-resolve-format=symlinked_immutable_virtualenv --resolve=python-default
h
resolves
is where you name your "universes" of third-party dependencies. So think of that as equivalent to a requirements.txt that has been expanded out to its transitive requirement closure (and indeed it is very common to use a requirements.txt to specify the inputs to a resolve). However, unlike with a virtualenv created from a requirements.txt, in a given context Pants uses just the necessary subset of that universe.
(so you don't end up depending on what you don't use)
Ideally you'd have just one resolve for your code, because that means your entire repo is mutually compatible, but sometimes you can't, in which case you can have more than one.
python-default
has become a sort-of convention for the name of your main or single resolve, but you can name it whatever you like.
šŸ™ 1
b
https://www.pantsbuild.org/2.20/docs/using-pants/setting-up-an-ide might have some specifics that are handy for you
šŸ™ 1