:wave: is there a command to download (all or some...
# general
s
👋 is there a command to download (all or some) packages in a given lockfile?
g
What's the use-case? What language?
s
ah - python is the language. the reason i ask is that sometimes it's handy to fetch everything in one shot to populate the local cache. i previously ran into this when planning to work from a metered internet connection: i wanted to fetch everything on an unmetered connection so that i didn't have to download as much while metered. today, the use case is that i'm considering a switch from public pypi to a private repo hosted on aws codeartifact and want to give users the ability to "download everything" while they have their short-lived credentials as i was unable to find any working plugins to handle the authentication
g
Right, thanks for the info! This mechanic does not exist at all in Pants to my knowledge, and similarly I'm not aware of it existing in Pex which we delegate most Python dependency work to. However, if we ignore the "ask"... IF there was a way for Pants to execute a process for the credential and feed it pex/pip, does such a tool exist? I.e, something like Docker credential helpers.
s
to my knowledge no such tool exists today, but it would be easy to create one
g
So would that be preferable over the vendor solution, or are there other considerations? I've got a very barebones plugin for credentials management which I haven't had a reason for upstreaming, but it was created to avoid handling plaintext credentials for
pants publish
. In this case it uses bitwarden, but adding a generic provider doesn't seem impossible. https://github.com/tgolsson/pants-backends/blob/main/pants-plugins/secrets/BUILD#L17-L19 https://github.com/tgolsson/pants-backends/blob/main/examples/bitwarden/BUILD
s
yes, i think that would work nicely
g
Ack! It'll need some design work since none of this exists in Pants mainline; but can you file an issue on github.com/pantsbuild/pants with the use-case and some info about the tool?
✅ 1
s
e
I'm not sure about how pants internals handle things (eg. relative to cache for later and stuff), but couldn't you just export your entire resolve as a venv, and pants would be forced to download all the packages?
s
that's what i had in mind if there wasn't a specific way to fetch everything, but it would mean exporting a venv for each resolve. not terrible, but not great, either
g
Ah yeah that would probably work, depends on how often your dependencies change, your interpreter constraints, etc. Could become quite unwieldy if it's a large matrix. (+ space on disk depending on what's in the resolves...)
s
it takes several minutes to export a venv for one of our resolves, so it's definitely not ideal