https://pantsbuild.org/ logo
#general
Title
# general
b

broad-hospital-96632

01/24/2023, 7:11 PM
Hello folks, I am reaching out to check if any of you had issues running pants targets behind proxies or in offline environments. We currenlty use pants in one of our main services to package multiple libraries, however in some situations we have to develop in environemnts behind proxies. pants package target seems to run for along period of time then timing out. Here’s what we tried with no success: 1. Set the env variables for HTTP_PROXY and HTTPS_PROXY with no success (fyi, pip works well after setting those up) 2. Following this recipe from pex official documentation: https://pex.readthedocs.io/en/v2.1.121/recipes.html#pex-and-proxy-settings seems that pex no longer package requests as extra dependency
Copy code
$ pip install pex[requests]
Collecting pex[requests]
  Downloading pex-2.1.121-py2.py3-none-any.whl (2.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 20.2 MB/s eta 0:00:00
WARNING: pex 2.1.121 does not provide the extra 'requests'
Installing collected packages: pex
Successfully installed pex-2.1.121
I would appreciate any help or guidance to run pants behind proxies and any recipes for running in offline mode as well.
e

enough-analyst-54434

01/24/2023, 7:17 PM
Set the env variables for HTTP_PROXY and HTTPS_PROXY with no success
Did you punch those env vars through Pants? You may be unaware Pants is hermetic and does not allow arbitrary env vars to leak into processes it runs unless you tell it to.
b

broad-hospital-96632

01/24/2023, 7:18 PM
I will do this right now
as recommended in the above link
e

enough-analyst-54434

01/24/2023, 7:18 PM
b

broad-hospital-96632

01/24/2023, 7:19 PM
thank you much appreciated
Yeap if only I looked deep enough in the docs, thank you very much