Hi everyone I have a problem with pants. In the pa...
# general
l
Hi everyone I have a problem with pants. In the part of my Python code there is the following phrase "import pkg_resources" As we know, this module is in the "setuptools" package, so I put this package in the "requirments.txt" file, but when I run the "./pants check" command, I get the following error: "[ERROR] The following imports in *: ../ python_sources have no owners: * pkg_resources "
n
Take a look at the section in the docs about requirements with undeclared dependencies, it has your exact issue with
pkg_resources
as an example 🙂
If that fails, there's also module_mapping that would solve it, e.g.
module_mapping={"setuptools": ["pkg_resources"]},
I'm fairly certain Pants already does the latter for you though.
l
thanks the module_mapping worked.
My another question is, can we get a version of a requirement by executing a Python command or Bash? for example: python_requirement( name="django", requirements=["Django==3.2.1"], ) can set "3.2.1" runtime?