https://pantsbuild.org/ logo
#general
Title
# general
r

refined-addition-53644

09/29/2022, 3:59 PM
Hi, with pants 2.14, I see lot of warnings like. I suppose this is because of namespace packages. What should I do to handle such warnings?
Copy code
15:49:36.77 [WARN] Pants cannot infer owners for the following imports in the target src/package-local/tests/utils/test_nlp.py:

  * tests.resources.fake (line: 5)
In this case
src/package-local
has structure like. We have multiple of such local packages each with their own tests.
Copy code
src/package-local
- package_local
- tests
h

happy-kitchen-89482

09/29/2022, 4:13 PM
This might be due to source root configuration
What does
./pants roots
show?
To import from
tests.resources.fake
you’d need the parent of
tests/resources/fake.py
to be a source root
r

refined-addition-53644

09/29/2022, 4:15 PM
This is
./pants roots
output
Copy code
pants-plugins
src/package-local
I do add all such local packages as source root
tests
is inside
src/package-local
h

happy-kitchen-89482

09/29/2022, 4:16 PM
so there is a src/package-local/tests/resources/fake.py?
r

refined-addition-53644

09/29/2022, 4:16 PM
yes
h

happy-kitchen-89482

09/29/2022, 4:17 PM
huh
Can you create a stripped-down github repo that reproduces the problem?
r

refined-addition-53644

09/29/2022, 4:17 PM
ok, let me try. Thank you!