purple-plastic-57801
03/06/2023, 11:44 PMpants dependencies --transitive observatory_api/observatory_api/rest.py
15:40:27.93 [WARN] The target observatory_api/observatory_api/rest.py imports `certifi`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['.build/requirements#certifi', 'observatory_api:reqs#certifi'].
Please explicitly include the dependency you want in the `dependencies` field of observatory_api/observatory_api/rest.py, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.
Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to <https://www.pantsbuild.org/v2.15/docs/troubleshooting#import-errors-and-missing-dependencies>.
15:40:27.93 [WARN] The target observatory_api/observatory_api/rest.py imports `urllib3`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['.build/requirements#urllib3', 'observatory_api:reqs#urllib3'].
I'm unsure where the observatory_api:reqs target is coming from.broad-processor-92400
03/06/2023, 11:46 PMobservatory_api/BUILD
file. What's in it?purple-plastic-57801
03/06/2023, 11:47 PMpurple-plastic-57801
03/06/2023, 11:47 PMpurple-plastic-57801
03/06/2023, 11:49 PMpython_sources()
python_requirements(
name="reqs",
)
python_requirements(
name="reqs0",
source="test-requirements.txt",
)
purple-plastic-57801
03/06/2023, 11:51 PM/
- observatory_api
- observatory_api
- api
- apis
...
- tests
I added the root source of
/observatory_api
When I run pants tailor ::
it drops a BUILD in /observatory_apipurple-plastic-57801
03/06/2023, 11:55 PMbroad-processor-92400
03/07/2023, 1:57 AMpython_requirements
in a single resolve, so that dependencies aren't imported twice. There's coincidentally a thread a few days ago about something similar: https://pantsbuild.slack.com/archives/C046T6T9U/p1677806156563409