worried-glass-66985
11/11/2025, 11:50 AMPants cannot infer owners for the following imports when some dependency is specified in several python_requirement targets. I have a small example to illustrate my problem. I would expect dependency to be:
1. If not specified explicitly for the target, then some merge of all other dependencies, or just take the exact version from lockfile
2. If specified, then use this dependency without any warningsfast-nail-55400
11/11/2025, 5:20 PMfast-nail-55400
11/11/2025, 5:22 PMpants.toml for all of your source code? https://www.pantsbuild.org/prerelease/reference/subsystems/source#root_patterns
2. Do the dependencies use top-level module names which are not the same as the name of the PyPI package? You might need to set module_mapping . https://www.pantsbuild.org/prerelease/reference/targets/python_requirements#module_mappingelegant-florist-94385
11/11/2025, 8:13 PM3rdparty/python/requirements.txt that defines all 3rd party dependencies used in our monorepo. (and a corresponding lockfile). Then, all my 1st party python lives in src/python/A, src/python/B, etc.
Individual projects within the monorepo don't need to specify dependencies, they just expect the universal resolve to have what they need. They will get whichever version happens to be picked during lockfile generation (which will be the latest version that is compatible with all other packages and constraints)elegant-florist-94385
11/11/2025, 8:13 PMworried-glass-66985
11/12/2025, 8:31 AMNot sure if this is the most recommended practice, but what I like to do is have athank you for the answer! I was thinking about it too. Although it leads to harder understanding what are the dependencies for the specific project. And in the future it will be harder to migrate some project to separate resolve or in separate repo if such need will arisethat defines all 3rd party dependencies used in our monorepo.3rdparty/python/requirements.txt
elegant-florist-94385
11/12/2025, 10:42 AMit leads to harder understanding what are the dependencies for the specific project.
pants dependencies --transitive ./path/to/project/entrypoint.py will list every target that is needed by entrypoint.py . If you add | grep 3rdparty you can use grep to filter it down to only the targets that came from the 3rd party dir