nice-florist-55958
03/10/2022, 1:29 PMrealpath
of the pants.toml
(SCM root) file inside pants.toml
file itself? We have a need to use file://
instead of external URLs, but this only works with absolute paths. Right now we are pointing to a shared network drive, but my preference is for this to point to files checked into SCM.
More generally, is there documentation of all accessible variables? I'm talking about things like {version}
. It doesn't look like Bash or Python are available in .toml
files.enough-analyst-54434
03/10/2022, 1:38 PM[DEFAULT]
section to DRY up your config as needed: https://github.com/pantsbuild/pants/blob/42db2fcafc9e87a9c6457a437dbc344c8920007b/src/python/pants/option/config.py#L200-L239nice-florist-55958
03/10/2022, 2:26 PM~/.config/pip/pip.conf
for each user.
Maybe this was already implicitly answered by your last reply, but can the index value in pants.toml be dynamically generated from a key/value pair in this conf file?happy-kitchen-89482
03/10/2022, 4:17 PM~/.pants.rc
~/.config/pip/pip.conf
~/.config/pip/pip.conf
into a toml file...hundreds-father-404
03/10/2022, 5:43 PMpublish
goal, which iirc reads from pip.conf
alreadynice-florist-55958
03/10/2022, 5:58 PM[python-repos]
indexes = ["..."]
The "..." is unique for each user because the URL contains their assigned API key, which is stored in their local pip.conf
(generated by an unrelated script).
We set this explicitly in pants
(the actual command script) by reading it and passing it along as an argument to any Pip invocations Pants makes, so users can bootstrap Pants (have not tried deploying Pants as a PEX yet, which might remove this step), but I think this option still needs to be set in pants.toml
so Pants can package pex_binary
targets by downloading/installing their 3rdparty requirements.
I think we will add a follow-on to the script that generates our internal PyPI API keys to also add this to ~/.pants.rc
hundreds-father-404
03/10/2022, 6:02 PMpants.toml
. I'm unlikely to have time to get to it, but help definitely appreciated if you had interest
Otherwise some options are to use .pants.rc
or env vars, e.g. add to your ./pants
script export PANTS_PYTHON_REPOS="+[\"${FOO}\"]
(string escaping might be off there)enough-analyst-54434
03/10/2022, 6:02 PM%(buildroot)s
interpolation earlier today and had to look at code and this reminds me that env vars could be supported trivially - 1 line of code + docsite updates by just stuffing os.environ in the defaults dict.hundreds-father-404
03/10/2022, 6:13 PMenough-analyst-54434
03/10/2022, 6:18 PM