full-toothbrush-75676
09/15/2021, 7:18 PMhundreds-father-404
09/15/2021, 7:26 PMhundreds-father-404
09/15/2021, 7:26 PMfull-toothbrush-75676
09/15/2021, 7:44 PM/3rdparty
requirements.txt
BUILD
/lib
org-project-1/
org/
__init__.py # we declare `org` as a namespace package here using `pkg_resources`
BUILD
project_1/
__init__.py
BUILD
org-project-2/
org/
__init__.py # also here
BUILD
project_2/
__init__.py
BUILD
pants.toml
First naïve question is: I’m having some trouble getting Pants to run tests in either of the two namespace packages (org.project_1
and org.project_2
) since it can’t find the pkg_resources
module. I’ve tried adding setuptools
(which ships with pkg_resources) to 3rdparty/requirements.txt
but Pants still can’t find pkg_resources
. Is there something obvious I’m forgetting to do? Thanks 🙂full-toothbrush-75676
09/15/2021, 7:46 PMmodule_mapping
full-toothbrush-75676
09/15/2021, 7:48 PMpkg_resources
is already included in the default module name mapping for setuptools
.busy-vase-39202
09/15/2021, 7:51 PMfull-toothbrush-75676
09/15/2021, 7:56 PMhappy-kitchen-89482
09/15/2021, 7:58 PMpkg_resources
? Assuming you're importing from it, dependency inference should pick that up and add a dep on your 3rdparty
setuptoolshappy-kitchen-89482
09/15/2021, 7:58 PM3rdparty:setuptools
?full-toothbrush-75676
09/15/2021, 8:17 PMhundreds-father-404
09/15/2021, 8:32 PM__init__.py
file? If so, set [python-infer].inits = true
in pants.toml: https://www.pantsbuild.org/docs/python-backend. Sorry, that's a really common gotchafull-toothbrush-75676
09/15/2021, 9:40 PM__init__.py
file! That did the trick 🙏