cool-easter-32542
05/18/2024, 10:53 PM--- a/BUILD
+++ b/BUILD
@@ -4,4 +4,8 @@
# A macro that turns every entry in this directory's requirements.txt into a
# `python_requirement_library` target. Refer to
# <https://www.pantsbuild.org/docs/python-third-party-dependencies>.
-python_requirements(name="reqs")
+python_requirements(name="reqs", resolve="python-default")
+python_requirements(name="other-reqs", resolve="python-other")
+
+__defaults__(all=dict(resolve=parametrize("python-default", "python-other")))
+
diff --git a/helloworld/translator/BUILD b/helloworld/translator/BUILD
index 7086f94..23ddf0b 100644
--- a/helloworld/translator/BUILD
+++ b/helloworld/translator/BUILD
@@ -4,6 +4,10 @@
# This target sets the metadata for all the Python non-test files in this directory.
python_sources(
name="lib",
+ overrides={
+ "translator.py": dict(resolve="python-other"), # Not working
+ "__init__.py": dict(resolve=parametrize("python-other")), # Working
+ }
)
After this patch, I would expect both helloworld/translator/translator.py and helloworld/translator/__init__.py to be only in python-other resolve.
However I get the following result:
$ pants list "helloworld/translator/translator.py"
helloworld/translator/translator.py:lib@resolve=python-default
helloworld/translator/translator.py:lib@resolve=python-other
$ pants list "helloworld/translator/__init__.py"
helloworld/translator/__init__.py:lib@resolve=python-other
Note that not using parametrize in the __defaults__ also make this work.
Pants version
Which version of Pants are you using?
2.20.0
pantsbuild/pantscool-easter-32542
05/28/2024, 9:03 AM