Hello Everyone ! I’m a devops engineer not familli...
# general
b
Hello Everyone ! I’m a devops engineer not familliar with Pants. I’m trying to allow Pants working with a SOCKS5 proxy to connect to a private python repository. • I followed the documentation here and pushed the environment variable required. Everything is working as expected, however I need to get
pysocks
library in the
venv used by Pants
(likely here
/home/circleci/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py38/lib/python3.8/site-packages
) Pip needs that library to retrieve packages, hence I have the error.
Copy code
Looking in indexes: <https://pypi.org/simple/>, <https://admin>:****@python-index.xxxxx.fr/simple/
  ERROR: Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support.
I installed
pysocks
at system venv (with pip), this is working as expected, but not while running Pants. ➡️ Can you tell me how I can add a library to the venv used by pants ? Thank you very much for your help.
c
To get packages into the Pants env, you list them under
[GLOBAL].plugins
in your `pants.toml`: https://www.pantsbuild.org/docs/reference-global#plugins (doesn’t have to be just pants plugins..) However, if it is
PEX
that is installing, this may not be enough, and I’ll have to defer how to address that.. 🙂
b
I have some of them already. I thought it was not possible because
pysocks
is provided in no backend_packages in the documentation
Copy code
backend_packages = [
  "pants.backend.python",
  "pants.backend.python.lint.black",
  "pants.backend.python.lint.flake8",
  "pants.backend.python.lint.pylint",
  "pants.backend.python.typecheck.mypy
So if I’d like to add
pysocks
I should just add
"pysocks"
to that array ?
c
Not the
backend_packages
but to
plugins
.
b
got it 😄 Thanks. I’m testing and will revert to you soon, thanks!
👍 1
e
@bland-soccer-72046 including full command line output might be helpful. If you are correct about
~/.cache/pants/setup/...
, that Pants bootstrap is controlled by the
./pants
script and knows almost nothing of
pants.toml
save for the
pants_version
.