Trying to debug an error from `pants dependents` :...
# general
f
Trying to debug an error from
pants dependents
๐Ÿงต
Error:
Copy code
pants.core.util_rules.unowned_dependency_behavior.UnownedDependencyError: Pants cannot infer owners for the following imports in the target ...:

  * pydantic.v1.ValidationError (line: 28)
In my
third-party/_pants/BUILD
file I have:
Copy code
python_requirement(
    name="pydantic",
    requirements=["pydantic==2.4.2"]
)
And I have a wheel for it:
Copy code
ACAM-M-RWLH: acam$ ls third-party/_pants/wheels/pydantic*
third-party/_pants/wheels/pydantic-2.4.2-py3-none-any.whl
third-party/_pants/wheels/pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl
ACAM-M-RWLH: acam$
Note: This is the folder my pants config points to:
Copy code
[python-repos]
find_links = [
    "file:///%(buildroot)s/third-party/_pants/wheels"
]
indexes = []
Does the
dependents
goal use a sandbox? I haven't been able to get
--keep-sandboxes
to work to debug this (it doesn't even print or log the name of the folder it's using).
Note: I'm not using any lockfiles yet.
Fixed the error (an earlier warning in the output tipped me off to an ambiguous owner issue). But still curious re: sandbox question above. ๐Ÿ™‚
c
Dependency inference for python is now done partially in rust (the parsing and identification of imports) and in the Pants process itself. there's an advanced goal python-dump-source-analysis, which can give you a window into the stages of the dep inference process for python. But I think all that's going to do is confirm that the problem is that Pants doesn't see something that provides the module
pydantic
. My first guess would be that Pants doesn't know that something provides pydantic. Do you have a
python_requirement
target that provides
pydantic
? (try with
pants list :: | grep pydantic
)
๐Ÿ‘ 1
f
So I had a requirements.txt hiding in another part of the tree that caused a conflict. Once I took care of that, all is working. Thanks for the tip re: the new python-dump-source-analysis feature!
๐Ÿ‘ 1