Closed jasondamour closed 4 days ago
Have you tried this option? https://www.pantsbuild.org/2.20/reference/subsystems/python-infer#ambiguity_resolution
It is intended to do exactly what you're suggesting.
We should probably switch the default though...
Oh wow, this seems exactly like what I'm looking for! Didn't think to check this separate backend.
Glad that worked for you! To clarify terms, python-infer
is a "subsystem" (a namespace of options), within the python backend.
Is your feature request related to a problem? Please describe. My repository has 20+ python module directories, each with a
pyproject.toml
. Therefore, lots of 3rd party dependencies throw the error:It doesn't seem to make sense to create separate
resolves
for each python directory, because versions are shared across all submodules to guarantee compatibility.Describe the solution you'd like Each of my python_source/python_test targets have only 1 poetry_requirements in the parent directory tree. It seems reasonable that if a dependency is declared only once in the parent directory tree, it could be assumed to be the owner.
For example:
Describe alternatives you've considered Otherwise, I'd have to explicitly add dependencies to 900+ targets in my repo:
Additional context This could/should be optional behavior in either dependency declaration (ie
poetry_requirements(recursive=true)
) or in the dependency consumer (iepython_sources(modules_from_parent_dirs=true)
, or could be configured globally in pants.toml