https://pantsbuild.org/ logo
#development
Title
# development
p

proud-dentist-22844

10/31/2022, 6:33 PM
RE: module disambiguation Could we have something like
module_mapping
for first party code? ie, when you encounter the
tests
module in this directory tree, it refers to the
tests
module defined in directory
bla/tests
So, something to tweak inference without adding a ton of
# pants: no-infer-dep
lines to code. I've already defined an explicit dependency to disambiguate the imports. 2.14 is now warning about them, so I have to figure out what to do to (cleanly) silence the warnings. I prefer to avoid changing the default for
[python-infer].unowned_dependency_behavior
(which changed from ignore to warning in 2.14).
Errors like this:
Copy code
13:27:38.08 [WARN] Pants cannot infer owners for the following imports in the target contrib/runners/orquesta_runner/tests/unit/test_basic.py:tests:

  * tests.unit.base (line: 32)

If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the import line. Otherwise, see <https://www.pantsbuild.org/v2.14/docs/troubleshooting#import-errors-and-missing-dependencies> for common problems.
Copy code
13:27:39.06 [WARN] Pants cannot infer owners for the following imports in the target st2common/tests/unit/test_db_pack.py:tests:

  * tests.unit.base.BaseDBModelCRUDTestCase (line: 22)

If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the import line. Otherwise, see <https://www.pantsbuild.org/v2.14/docs/troubleshooting#import-errors-and-missing-dependencies> for common problems.