Hi,
we have a code base with native namespace packages.
It has the following structure:
src/
subpackage_a
namespace
# no __init__.py here!
subpackage_a
subpackage_b
namespace
# no __init__.py here!
subpackage_b
When I run pytype --keep-going src/subpackage_a/namespace, the type checking fails with a ton of import errors.
As soon as I add __init__.py files to the namespace packages (can be empty or pkgutil style), and then run the same command, the pytype check succeeds. The same happens if I run pytype -k src/subpackage_a/namespace/subpackage_a.
After adding the __init__.py files, I have the following structure:
src/
subpackage_a
namespace
__init__.py
subpackage_a
subpackage_b
namespace
__init__.py
subpackage_b
pytype version: 2019.11.27
python version: 3.7.5
OS: MacOS catalina
I know this is probably hard to reproduce for you, but I'd really appreciate any hints on that. Thanks a lot for your help!
Hi,
we have a code base with native namespace packages.
It has the following structure:
When I run
pytype --keep-going src/subpackage_a/namespace, the type checking fails with a ton of import errors.As soon as I add
__init__.pyfiles to the namespace packages (can be empty orpkgutilstyle), and then run the same command, the pytype check succeeds. The same happens if I runpytype -k src/subpackage_a/namespace/subpackage_a.After adding the
__init__.pyfiles, I have the following structure:pytype version: 2019.11.27
python version: 3.7.5
OS: MacOS catalina
I know this is probably hard to reproduce for you, but I'd really appreciate any hints on that. Thanks a lot for your help!