cold-soccer-63228
05/20/2022, 3:21 AMgoogle-api-python-client and google-auth libraries. In Python code, they're both referred to as google, for example:
from google import auth
from google import api_core
I noticed that I can't specify two separate module_mappings where the values are the same, otherwise the build system gets confused...fast-nail-55400
05/20/2022, 3:29 AMpython_sources targets for the code that is importing those modules.fast-nail-55400
05/20/2022, 3:32 AMmodule_mappings feature is part of the Pants “dependency inference” feature which tries to automatically infer dependencies. In cases where it cannot, you can still use the dependencies field on a target to explicitly set the dependency.)fast-nail-55400
05/20/2022, 3:32 AMpython_requirements() target?fast-nail-55400
05/20/2022, 3:33 AMpython_requirements plus # then the name of the Python module.fast-nail-55400
05/20/2022, 3:34 AM3rdparty/py#google-api-python-client if the file 3rdparty/BUILD had a python_requirements(name="py") targetcold-soccer-63228
05/20/2022, 4:26 AMpath/to/source.py having a dependency on path/__init__.py, but the dependency not being inferred.
So I went ahead and added the following explicitly.
python_sources(
dependencies=["path/__init__.py"]
)bitter-ability-32190
05/20/2022, 10:35 AMmodule_mappings!
module_mappings allow for any valid package name, so in your case google-api-python-client should map to google.api_core and likewise fgor google-authbitter-ability-32190
05/20/2022, 10:36 AMbitter-ability-32190
05/20/2022, 10:37 AMAhh, I realized my issue was related to something else altogether. It ended up being due toThis shouldn't be necessary. Do your inits have contents? If so you might want to set https://www.pantsbuild.org/docs/reference-python-infer#section-initshaving a dependency onpath/to/source.py, but the dependency not being inferred.path/__init__.py
cold-soccer-63228
05/20/2022, 2:40 PM__init__.py files, but we're trying to migrate off of it...bitter-ability-32190
05/20/2022, 2:42 PMbitter-ability-32190
05/20/2022, 2:42 PM