Hi, I have a problem with the dependency inference...
# general
m
Hi, I have a problem with the dependency inference of pants. I have some applications which need some requirements and libraries that need some requirements. I created a global requirements.txt file that contains all the requirements and I’m counting on pants to use only the dependencies it needs, the problem is that if an app doesn’t import directly dependency that lib needs, pants wouldn’t add this dependency to the pex interpreter. For example I have a configuration library that needs pyyaml as a requirement, because that my app doesn’t import pyyaml (it import the configuration) pants doesn’t add it - if I import pyyaml in my app the configuration library also can use it
1
h
This should not be the case. Assuming your configuration library (which I assume is consumed as a distribution) declares pyyaml as one of its own requirements, Pants (via Pex) will resolve all those transitive requirements.
If you’re seeing otherwise then it would be very helpful to have a repo that reproduces this.
m
The problem was I didn’t have one of the python files in my python sources pattern
Thank you 🙏
h
Glad that got sorted out