<#20933 Overrides not working with parametrized de...
# github-notifications
c
#20933 Overrides not working with parametrized default Issue created by isra17 Describe the bug I took the time to create an example off the example python repo. See here:
Copy code
--- 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:
Copy code
$ 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/pants