freezing-fall-2672
09/14/2023, 12:28 PMfoo_base.tenant_switcher.apps.TenantSwitcherConfig
, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['foo/connect:foo-base', 'foo/connect:reqs#foo-base'].
does this make sense?freezing-fall-2672
09/14/2023, 12:30 PMnarrow-vegetable-37489
09/14/2023, 12:33 PMfoo_base
is a python_requirement
or python_requirements
, you can explicitly add django-json-widget
as a dependency to it: https://www.pantsbuild.org/docs/python-third-party-dependencies#requirements-with-undeclared-dependenciesfreezing-fall-2672
09/14/2023, 12:34 PMpython_sources()
python_requirement(
name="django_json_widget",
requirements=["django-json-widget"],
)
python_requirement(
name="foo-base",
requirements=["foo-base"],
dependencies=[":django_json_widget"],
)
python_requirements(
name="reqs",
module_mapping={
"django-parler": ["parler"],
"django-parler-rest": ["parler_rest"],
"django-environ": ["environ"],
"django-autocomplete-light": ["dal"],
}
)
freezing-fall-2672
09/14/2023, 12:36 PMnarrow-vegetable-37489
09/14/2023, 12:37 PMrequirements.txt
read by python_requirements
also has foo-base
in it? In that case you want to add
overrides={
"foo-base": {"dependencies": [":reqs#django-json-widget"]},
},
to your python_requirements
insteadnarrow-vegetable-37489
09/14/2023, 12:38 PMpython_requirement
with foo-base
.freezing-fall-2672
09/14/2023, 12:40 PMpython_requirements(
name="reqs",
module_mapping={
"django-parler": ["parler"],
"django-parler-rest": ["parler_rest"],
"django-environ": ["environ"],
"django-autocomplete-light": ["dal"],
},
overrides={
"foo-base": {"dependencies": [":reqs#django_json_widget"]},
},
)
I get this error:
ValueError: The explicit dependency `foo/connect:reqs#django_json_widget` of the target at `foo/connect:reqs#foo-base` does not provide enough address parameters to identify which parametrization of the dependency target should be used.
with a list of possible addressesfreezing-fall-2672
09/14/2023, 12:40 PMfreezing-fall-2672
09/14/2023, 12:41 PMfreezing-fall-2672
09/14/2023, 12:41 PMnarrow-vegetable-37489
09/14/2023, 12:42 PMdjango-json-widget
as well? If not, you still need a python_requirement
for that dependency, and the address in your overrides
would then be :django_json_widget
(or w/e you name it).freezing-fall-2672
09/14/2023, 12:43 PMfreezing-fall-2672
09/14/2023, 12:43 PMdjango-json-widget
not django_json_widget
freezing-fall-2672
09/14/2023, 12:43 PMfreezing-fall-2672
09/14/2023, 12:44 PMpython_source
target isn't needed at allfreezing-fall-2672
09/14/2023, 12:45 PMfreezing-fall-2672
09/14/2023, 12:47 PMfreezing-fall-2672
09/14/2023, 12:49 PM