cold-soccer-6322805/20/2022, 3:21 AM
libraries. In Python code, they're both referred to as
, for example:
I noticed that I can't specify two separate
from google import auth from google import api_core
where the values are the same, otherwise the build system gets confused...
fast-nail-5540005/20/2022, 3:29 AM
targets for the code that is importing those modules.
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
field on a target to explicitly set the dependency.)
then the name of the Python module.
if the file
cold-soccer-6322805/20/2022, 4:26 AM
having a dependency on
, but the dependency not being inferred. So I went ahead and added the following explicitly.
python_sources( dependencies=["path/__init__.py"] )
bitter-ability-3219005/20/2022, 10:35 AM
allow for any valid package name, so in your case
should map to
and likewise fgor
Ahh, 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 on
path/to/source.py, but the dependency not being inferred.
cold-soccer-6322805/20/2022, 2:40 PM
files, but we're trying to migrate off of it...
bitter-ability-3219005/20/2022, 2:42 PM