I have a library which has a dependency on a third...
# general
b
I have a library which has a dependency on a third party module
python-json-logger
, this module is imported as
from pythonjsonlogger import ...
, in the library I import this module and make custom functions and classes. I import these classes and utilities somewhere else, in other projects within the monorepo. When I run
pants dependencies --dependencies-transitive other/project/file.py
it is not able to pick the
python-json-logger
as a dependency, even though i have added
python_requirements("reqs", module_mapping={'python-json-logger': ('pythonjsonlogger, )})
in the
BUILD
file, placed inside the library and mentioned
python-json-logger
in
requirements.txt
. How can I ensure that this module is captured as a dependency?
b
Sorry for the trouble. That module mapping looks plausible… Are there any warnings?
b
no warnings
I think I figured out, I have another project in the same monorepo, where, in it's
requirements.txt
I have mentioned
python-json-logger
. So basically
python-json-logger
was mentioned in two
requirements.txt
. When I removed from one, it started showing up in dependencies. I guess, what's happening is, it is not able to identify the correct owner of
python-json-logger
hence not including in the list. But I assumed, in such cases, pants will throw a warning, when I run
pants dependencies --dependencies-transitive ...
. I can see such warnings if I run in debug mode with option
-ldebug