proud-appointment-36730
06/22/2022, 7:11 PMBUILD
files? For context, looking to configure the repositories
field of a python_distribution
proud-appointment-36730
06/22/2022, 7:14 PMproud-appointment-36730
06/22/2022, 7:15 PM.pypirc
file as a centralized place for storing repo config, but also trying to avoid hardcoding the repository
field in a bunch of BUILD
filesproud-dentist-22844
06/22/2022, 8:28 PMrepositories
field, I already had a macro that wraps python_distribution
so I added it there - one place for the whole repo. https://github.com/st2sandbox/st2/blob/pants/pants-plugins/macros.py#L100-L104proud-dentist-22844
06/22/2022, 8:31 PMpublish
, but it looks like it would be awkward to switch from prod to test pypi indexes. Using env vars or a cli arg or something could be nice for that as well.
Once __defaults__
is merged, then that would provide an easy way to set repository
without relying on a macro. https://github.com/pantsbuild/pants/pull/15836proud-appointment-36730
06/22/2022, 9:12 PM.pypirc
file to get unstuck but this macros thing is an interesting feature that I haven't touched yetcurved-television-6568
06/22/2022, 9:27 PMpython_distribution(..., repositories=["@some_repo"])
Would use this section from your .pypirc
[some_repo]
repository = https://...
username = __token__
password = pypi-...
as example..proud-appointment-36730
06/22/2022, 10:07 PMcurved-television-6568
06/22/2022, 10:12 PMproud-appointment-36730
06/22/2022, 10:16 PMBUILD
files, which I was trying to avoid. I was hoping to pull the repository
argument of a python_distribution
target in from an environment variable, but using a file that I write out at setup time is turning out to work just finecurved-television-6568
06/23/2022, 8:05 AMTWINE_REPOSITORY_URL_<repository>
variable.curved-television-6568
06/23/2022, 8:05 AM