Skip to content

Source file found twice under different module names error raise by mypy #798

@tromai

Description

@tromai

How to reproduce the issue

mkdir /tmp/test
cd /tmp/test
git clone https://github.com/oracle/macaron
cd macaron
git checkout staging

python3.11 -m venv .venv
. .venv/bin/activate
make setup

make check

The error message from mypy pre-commit hook

src/macaron/__main__.py: error: Source file found twice under different module names: "macaron.__main__" and "__main__"
src/macaron/__main__.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
src/macaron/__main__.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)
Success: no issues found in 31 source files
Success: no issues found in 31 source files
Success: no issues found in 31 source files
src/macaron/__main__.py: error: Source file found twice under different module names: "macaron.__main__" and "__main__"
src/macaron/__main__.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
src/macaron/__main__.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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions