hundreds-carpet-28072
08/29/2024, 4:15 PM_init_.py
files. I have a file structure like:
proj
-- src
-- main.py
-- __init.py
Files containing:
# __init__.py
import logging
logger = logging.getLogger(__name__)
# src/main.py
from proj import logger
I have set [python-infer].init_files = always
but that doesn’t seem to make a difference here. Am I missing something?hundreds-carpet-28072
08/29/2024, 4:26 PM[python-infer]
ambiguity_resolution = "by_source_root"
^ doesn’t seem to help either, which I would’ve assumed wouldbetter-van-82973
08/29/2024, 4:37 PMpants roots
?hundreds-carpet-28072
08/29/2024, 4:42 PMproj
is in source roots in this scenario. I did get to the bottom of the problem though. proj/__init__.py
wasn’t owned so when the from proj import logger
symbol was being resolved this implied no ownership for that also.hundreds-carpet-28072
08/29/2024, 4:44 PM[WARN] Pants cannot infer owners for the following imports in the target …
is very general. If the consumer is owned by something but its local dependency is not then it would be more helpful to point to proj/__init__.py
not being owned rather than an ambiguity problem