ambitious-actor-36781
11/14/2021, 9:32 PMmypy
to my project.
But continuously getting this error:
š MyPy failed.
10:29:21.85 [ERROR] Completed: Typecheck using MyPy - MyPy failed (exit code 2).
test/python/gcloud/conftest.py: error: Duplicate module named "conftest" (also at "test/python/editor/score/conftest.py")
test/python/gcloud/conftest.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)
So now (due to: https://github.com/pantsbuild/pants/issues/13615) I'm adding
overrides={"conftest.py": {"skip_mypy": True}}
to all my python_test_utils
but it feels like I'm doing something wrong?curved-television-6568
11/14/2021, 9:43 PMpython_test_utils
test target. Working on a PR for that..hundreds-father-404
11/14/2021, 9:45 PM./pants roots
say?
And thank you Andreas!! Definitely an oversight, I agree it should be registeredambitious-actor-36781
11/14/2021, 9:46 PMā°āā¤ ./pants roots
10:46:13.06 [INFO] Initializing scheduler...
10:46:13.13 [INFO] Scheduler initialized.
build-support
pants-plugins
src/python
test/python
hundreds-father-404
11/14/2021, 9:48 PM__init__.py
files or relying on PEP ambitious-actor-36781
11/14/2021, 9:49 PMtest/python $ git ls-files | grep "\(__init__.py\|conftest.py\)"
editor/conftest.py
editor/score/conftest.py
editor/score/content_score_data/__init__.py
editor/integrations/conftest.py
i_admin/conftest.py
i_caching/conftest.py
i_gcloud/conftest.py
msglib/conftest.py
rest_api/conftest.py
sauth/conftest.py
s_app/conftest.py
s_app/s_app_test_package/__init__.py
ambitious-actor-36781
11/14/2021, 9:51 PMsrc/python
has a lot of ___init___
fileshundreds-father-404
11/14/2021, 9:53 PMhundreds-father-404
11/14/2021, 9:53 PMtests/python
tho!ambitious-actor-36781
11/14/2021, 9:55 PMhundreds-father-404
11/14/2021, 9:57 PMambitious-actor-36781
11/15/2021, 2:43 AM__init__.py
files to test folders worked.
But broke other things. so just gonna skip mypy on everything in tests
ambitious-actor-36781
11/15/2021, 2:46 AMgunicorn.app.wsgiapp
working tho.
Stubs folder work, i can add
import fake_module
and w/ src/mypy-stubs/fake_module.pyi
mypy doesn't even mention it.
./pants dependencies src/python/infloai/util/django/service.py
3rdparty:django
3rdparty:gunicorn
src/mypy-stubs/gunicorn/app/wsgiapp.pyi:../../lib
src/python/infloai/util/django/gunicorn_conf.py
src/python/infloai/util/django/wsgi.py
Suspect it's something to do with the __init__.pyi
files not being picked up?
find src/mypy-stubs
src/mypy-stubs
src/mypy-stubs/BUILD
src/mypy-stubs/gunicorn
src/mypy-stubs/gunicorn/app
src/mypy-stubs/gunicorn/app/wsgiapp.pyi
src/mypy-stubs/gunicorn/app/__init__.pyi
src/mypy-stubs/gunicorn/__init__.pyi
hundreds-father-404
11/15/2021, 4:34 PM__init__.py
?
That very well could be
Also are those empty?ambitious-actor-36781
11/16/2021, 1:46 AMhundreds-father-404
11/16/2021, 2:14 AM__init__.py
rather than .pyi
. Are you able to use that? Fwict there's no difference?ambitious-actor-36781
11/17/2021, 1:11 AM__init__.pyi
files to .py
didn't change anything, still getting
14:05:31.26 [ERROR] Completed: Typecheck using MyPy - MyPy failed (exit code 1).
src/python/infloai/util/django/service.py:30: error: Skipping analyzing "gunicorn.app.wsgiapp": found module but no type hints or library stubs
src/python/util/django/service.py:30: note: See <https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports>
ambitious-actor-36781
11/17/2021, 1:28 AMimport foobar
in a file
and then make a src/mypy-stubs/foobar.pyi
it workshundreds-father-404
11/17/2021, 1:30 AMambitious-actor-36781
11/17/2021, 1:31 AMambitious-actor-36781
11/17/2021, 1:33 AMsrc/mypy-stubs/docker/_init_.pyi
seems to work
š¤·āāļø might just # type: ignore
that one gunicorn importambitious-actor-36781
11/17/2021, 1:35 AMhundreds-father-404
11/17/2021, 1:35 AMfoo.bar.baz
, look up:
ā¢ Is there a first-party module called foo.bar.baz
or foo.bar
. Where we allow a parent module to accommodate imports like from foo.bar import Baz
ā¢ Is there a third-party module that exposes any of those modules, like foo.bar.baz
, foo.bar
, or foo
?
If both first-party and third-party, only allow first-party if it is exactly one type stub. Else, ambiguityambitious-actor-36781
11/17/2021, 1:35 AMambitious-actor-36781
11/17/2021, 1:35 AMambitious-actor-36781
11/17/2021, 1:37 AMdocker
docker.errors
and docker.models.images
all workambitious-actor-36781
11/17/2021, 1:37 AMambitious-actor-36781
11/17/2021, 1:38 AMdocker.models.images.pyi