adamant-oil-53479
07/27/2022, 11:49 AM./pants dependencies ::
Discover all the relevant dependencies, however
./pants dependencies path_to_a_specific_test.py
Doesn’t “find” all the relevant dependencies in the test file, failing it accordingly for a ModuleNotFoundError.
Can/Should I manually add dependencies to a BUILD file? Thanksbitter-ability-32190
07/27/2022, 11:58 AMadamant-oil-53479
07/27/2022, 12:25 PMbitter-ability-32190
07/27/2022, 12:43 PMadamant-oil-53479
07/27/2022, 1:02 PM[GLOBAL]
pants_version = "2.12.0"
backend_packages.add = [
"pants.backend.python",
"pants.backend.python.lint.black",
]
[anonymous-telemetry]
enabled = false
[source]
root_patterns = ["/"]
[python]
tailor_ignore_solitary_init_files = false
[python-infer]
inits = true
After ./pants tailor, when running ./pants test tests/test_exporter_factory.py
I get No module named 'opentelemetry'
even-though the relevant package (opentelemetry-sdk in this case) appears under root when running ./pants dependencies ::
bitter-ability-32190
07/27/2022, 1:48 PMopentelemetry-sdk
and the module name opentelemetry
don't match, you'll want to set `module_mapping`: https://www.pantsbuild.org/docs/python-third-party-dependencies#use-modules-and-module_mapping-when-the-module-name-is-not-standardadamant-oil-53479
07/27/2022, 4:04 PMcurved-television-6568
07/28/2022, 6:39 AMbitter-ability-32190
07/28/2022, 11:21 AMcurved-television-6568
07/28/2022, 11:32 AM