plain-fireman-49959
11/23/2021, 2:17 PM./pants dependencies source_root/org/project
?curved-television-6568
11/23/2021, 2:20 PM./pants dependencies source_root/org/project/main.py
?plain-fireman-49959
11/23/2021, 2:33 PMroot_source/org/other_project
init.py. That's probably because I added
[python-infer]
inits = true
plain-fireman-49959
11/23/2021, 2:43 PM--transitive
option and see all the deps, but when running the check
goal on main.py fails to find implementations or stubs for import in the same folder or in a submodulecurved-television-6568
11/23/2021, 3:12 PM./pants roots
give you the correct roots?
Related docs: https://www.pantsbuild.org/docs/source-rootsplain-fireman-49959
11/23/2021, 3:13 PM.
and src
which are correct (I assumed I need .
for the main poetry pyproject.toml fileplain-fireman-49959
11/23/2021, 3:14 PMsrc/org/project, src/org/submodule_a/ and submodule_b
, they only contains python_sources
macrocurved-television-6568
11/23/2021, 3:14 PM.
as you can refer to the pyproject.toml file from configuration alone.curved-television-6568
11/23/2021, 3:15 PM__init__.py
files?curved-television-6568
11/23/2021, 3:17 PMorg.submodule_a.
etc.. ?plain-fireman-49959
11/23/2021, 3:22 PMplain-fireman-49959
11/23/2021, 3:23 PM___all___
plain-fireman-49959
11/23/2021, 3:23 PM.
source root!curved-television-6568
11/23/2021, 3:38 PMplain-fireman-49959
11/23/2021, 3:38 PMcurved-television-6568
11/23/2021, 3:40 PMhappy-kitchen-89482
11/23/2021, 7:39 PM.
src root does no harm, as we take the innermost root, in this case src
happy-kitchen-89482
11/23/2021, 7:42 PMmain.py
look like? What is the package root for them?happy-kitchen-89482
11/23/2021, 7:42 PMimport org.project.submodule_a.[some]
for example?plain-fireman-49959
11/24/2021, 10:00 AMplain-fireman-49959
11/24/2021, 11:11 AM__all__
). I changed those to absolute and I still get the same result: main only displays direct deps (which might be correct), mypy can't follow any import, but packaging works correctly and builds a working pex.curved-television-6568
11/24/2021, 11:36 AM# pants.toml
[mypy]
args = "--namespace-packages --explicit-package-bases"
config = "mypy.ini"
And
# mypy.ini
[mypy]
mypy_path = src
show_error_codes = True
To give you some ideas… if at all relevant?plain-fireman-49959
11/24/2021, 11:45 AMmypy_path
was definitely missing (did not realize that in the example repo the source root was the repo root), I had to use the args
too. The example repo also uses "absolute" imports but does not seem to need those args... those did fix it however! thank you very much!curved-television-6568
11/24/2021, 11:47 AMplain-fireman-49959
11/24/2021, 11:49 AMmypy.ini
, correct? mypy still can't find stubs for a library that needs a plugin for typing, any ideas? am I missing something again? 😄curved-television-6568
11/24/2021, 11:51 AMcurved-television-6568
11/24/2021, 11:56 AM