You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Source file found twice under different module names #141
Starting with mypy 0.990, when testing a module in a namespace, mypy starts emitting errors when it encounters that module:
error: Source file found twice under different module names: "abode" and "jaraco.abode"
The issue almost certainly has the same root cause as pytest-dev/pytest#3396. Pytest is too reliant on the old assumption that a directory without an __init__.py is not a package, but that assumption doesn't hold since Python 3.3.
I observe that a similar error occurs when running the mypy manually:
jaraco.abode main $ .tox/python/bin/mypy .
jaraco/abode/helpers/constants.py: error: Source file found twice under different module names: "abode.helpers.constants" and "jaraco.abode.helpers.constants"
jaraco/abode/helpers/constants.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
jaraco/abode/helpers/constants.py: note: Common resolutions include: a) adding `__init__.py` somewhere, b) using `--explicit-package-bases` or adjusting MYPYPATH
Found 1 error in 1 file (errors prevented further checking)
It seems that mypy is giving a poor experience by default to namespace packages, and can be worked around by setting explicit package bases in the command line or config file.
Activity
Pin mypy to '<0.990' due to realpython/pytest-mypy#141
jaraco commentedon Nov 10, 2022
I observe that a similar error occurs when running the mypy manually:
jaraco commentedon Nov 10, 2022
It seems that mypy is giving a poor experience by default to namespace packages, and can be worked around by setting explicit package bases in the command line or config file.
jaraco commentedon Nov 10, 2022
Closing in favor of python/mypy#14057.
pypi-jaraco.text: Autospec creation for update from version 3.10.0 to…
pypi-tempora: Autospec creation for update from version 5.0.2 to vers…
pypi-jaraco.context: Autospec creation for update from version 4.1.2 …
pypi-setuptools: Autospec creation for update from version 65.5.1 to …
pypi-zipp: Autospec creation for update from version 3.10.0 to versio…
pypi-importlib_metadata: Autospec creation for update from version 5.…
pypi-importlib_resources: Autospec creation for update from version 5…
pypi-keyring: Autospec creation for update from version 23.11.0 to ve…
pypi-jaraco.functools: Autospec creation for update from version 3.5.…
pypi-jaraco.collections: Autospec creation for update from version 3.…
pypi-inflect: Autospec creation for update from version 6.0.2 to vers…
Pin mypy to '<0.990' due to realpython/pytest-mypy#141
pypi-portend: Autospec creation for update from version 3.1.0 to vers…
pypi-configparser: Autospec creation for update from version 5.3.0 to…
pypi-jaraco.classes: Autospec creation for update from version 3.2.3 …