https://pantsbuild.org/ logo
h

high-egg-2153

02/10/2021, 6:57 PM
Looks like environment variables cannot be used in pants.toml. Mine has a path that is specific to my laptop :
[python-repos]
repos.add = ["file:///home/greg/Work/mesh/mesh-dash/packages"]
What are my options to make this generic?
h

hundreds-father-404

02/10/2021, 7:00 PM
Indeed. See https://github.com/pantsbuild/pants/issues/10399 Pants will interpolate the special strings
"%(homedir)s"
, and same with buildroot and user
Copy code
repos.add = ["%(homedir)s/mesh/mesh-dash/packages"]
The alternative is using Pants env vars, e.g. having users set up a pantsrc file. See the global option
--pantsrc-files
h

high-egg-2153

02/10/2021, 7:13 PM
Perfect thanks again!!
❤️ 1
e

enough-analyst-54434

02/10/2021, 10:58 PM
But also, unless Pants is doing too much processing, you can simply:
Copy code
repos.add = ["~/mesh/mesh-dash/packages"]
Pants hands off to Pex and Pex does no processing and Pip handles this just fine.
👍 1