I think I might be seeing an inference error: ```a...
# general
b
I think I might be seeing an inference error:
Copy code
a/
├─ b/
│  ├─ c/
│  │  ├─ d/
│  │  │  ├─ __init__py
│  │  ├─ foo.py
Copy code
# foo.py
from a.b.c import d
Running
pylint
from inside
pants
gives:
E0611(no-name-in-module), ] No name 'd' in module 'a.b.c'
But running
pylint
on the file doesn't have the issue. Setting
[python-infer].inits=true
doesn't seem to alleviate the issue
Additionally
./pants peek a/b/c/foo.py
doesn't show
d
as a dependency.
h
what are the contents of
d/__init__.py
?
b
non-empty.
Copy code
from typing import Any, Callable


def apply(f: Callable, *args: Any, **kwargs: Any) -> Any:
  return f(*args, **kwargs)
h
is there more to the pylint error? Something is trying to import
a.b.c.d
?
b
Yeah,
foo.py
is
👍 1
h
to double check, you have a BUILD file in
a/b/c/d
?
🙌 1
b
Oh my...
oh oops
I suppose
tailor
isn't
__init__.py
-aware?
Or does it refer to
[python-infer].inits
? (In which case I ran
tailor
with it off initially)
h
it is, we have a bad default it looks like for
[python].ignore_solitary_init_files
..
👀 1
you can set that to
= false
under
[python]
(if on Pants 2.8) would you be willing to open a bug report please? that's super confusing this happpened
the option was an attempt to reduce BUILD file boilerplate. People were wondering why we are generating BUILD files in directories with only a single blank
__init__.py
It should probably instead detect if the
__init__.py
is empty or not
b
Ahh you beat me to it!
Was going to suggest that
1
h
In the meantime to fixing this, I updatd the docs Edit: and it got deleted...let's try again https://www.pantsbuild.org/v2.8/docs/python-backend
b
There's a typo (or "piritually" is a word I don't know about) 😂
😂 1
b
I kinda need that word to exist now.