I have a question regarding Pants' pex dependency....
# general
p
I have a question regarding Pants' pex dependency. I have a new laptop on a corporate network behind a web filter. When trying to run a python goal. I am getting the following error.
Copy code
IntrinsicError: Client error (403) downloading file pex from <https://github.com/pex-tool/pex/releases/download/v2.3.1/pex>
I have requested out IT department make an exception for the dependency to be allowed in the web filter. I have been waiting over a month after back-and-forth with justification, etc. and have little faith I will ever get access. Is there a way to define the dependency to point to an external instance of pex or some other loophole that removes downloading the pex package from github? 🤞
d
You can use the
known_versions
and
version
settings to specify a different URL. e.g. I tried this out locally and it seems to work:
Copy code
pants package --pex-cli-known-versions="['v2.33.2|macos_arm64|b6c035db294d9c84d72ec723c8bb31c9640e3a8603dbc48233352c1db1ccf5e8|4588594|file:///abs/path/to/pex']" --pex-cli-version="v2.33.2"
Figuring out the right thing to put in
file://
might require a bit of trial and error, but I imagine you could use environment variable substitution to reference a file within the repo... https://www.pantsbuild.org/stable/reference/subsystems/pex-cli#known_versions
p
Thanks for the response Joe! This will at least get me unblocked if I can get it to work. I still need to get the package file on my laptop or at accepted URL but I can hopefully find a way.
w
Just making sure you’ve also read this page: https://www.pantsbuild.org/stable/docs/using-pants/restricted-internet-access#installing-pants Some notes on other backends/tools that might get downloaded
👍🏻 1
p
Thanks SJ! I've seen this as I had to work on some cert issues as well. I missed the Binary Tools section before which follows Joe's suggestion of self-hosting. I was able to download the binary from a VM and have it local now 🤫
🎉 1