5

I've been unable run MyPy without it complaining about duplicate modules. I found this existing SO post and tried both to exclude setup.py and to have MyPy not follow imports, but I'm still experiencing the following output:

mypy --follow-imports skip --exclude 'setup' --exclude 'setup.py' --exclude setup --exclude '/setup$' --exclude '/setup.py$' --exclude '/init.py$' .

test-ghilston-python-cookiecutter/example_package_with_logging/setup.py: error: Duplicate module named 'setup' (also at './test-ghilston-python-cookiecutter/example_package/setup.py')

test-ghilston-python-cookiecutter/example_package_with_logging/setup.py: note: Are you missing an init.py? Alternatively, consider using --exclude to avoid checking one of them.

Found 1 error in 1 file (errors prevented further checking)

I've added quite a few --exclude parameters to showcase attempting to pass in a variety of different ways to represent the file setup.py.

One can read the official documentation describing the exclude flag here, which I believe I am following correctly.

Any help is appreciated, as clearly this is user error on my part.

Greg Hilston
  • 2,397
  • 2
  • 24
  • 35

0 Answers0