rhythmic-church-81435
06/16/2024, 3:23 PMsrc/python/libs/lib1
src/python/libs/lib2
src/python/machines/p1
src/python/machines/p2
src/python/machines/p3
The source roots are configured as /src/automation/python/*/*/
.
Running pants dependencies
on any of the libs correctly infers all first-party and third-party dependencies. However, running the same command on any of the projects results in warnings that Pants cannot infer owners for certain imports.
Here's the specific issue:
• The projects (p1
, p2
, p3
) have very similar structures and contain files with the same filenames.
• When these files are imported in the projects, Pants throws warnings that it cannot infer the owners of these imports, likely due to the filename duplication across the projects.
How can I set up the source roots or configure Pants to resolve these imports correctly?happy-kitchen-89482
06/16/2024, 3:51 PMhappy-kitchen-89482
06/16/2024, 3:51 PMhappy-kitchen-89482
06/16/2024, 3:51 PMrhythmic-church-81435
06/16/2024, 3:59 PMBUILD
files for the p
projects look the same and are structured like this:
python_sources(
name="p160",
sources=[
"main.py",
"src/*.py",
"src/**/*.py",
],
dependencies=[
"src/automation/python/libs/gutils:gutils",
"src/automation/python/libs/gvision:gvision",
"src/automation/python/machines/shared:shared",
"3rdparty/python:default-requirements#PyQt5",
"3rdparty/python:default-requirements#pyLucidIo",
],
)
For example, all p
projects have src/app.pyrhythmic-church-81435
06/16/2024, 4:43 PMsrc
folder to something unique per projecthappy-kitchen-89482
06/16/2024, 8:27 PMsrc
is above your source root, so that won't helphappy-kitchen-89482
06/16/2024, 8:28 PMhappy-kitchen-89482
06/16/2024, 8:28 PM