https://pantsbuild.org/ logo
#general
Title
# general
a

ambitious-actor-36781

11/17/2021, 10:16 PM
so.. weird one.. added mypy one mergerequest ago. used a lockfile, added some .pyi stubs for a library, all working. CI built and deployed. 👍 great Today, adding isort. same deal, everything (test, check, lint) working locally. But now mypy when running in CI is complaining about no stubs. looks like mypy fails when i'm using
--changed-since
Copy code
╭─xlevus@xd1 ~/Projects/_mono  ‹feat/isort› 
╰─➤  ./pants check --changed-since=origin/master                                                                                                         1 ↵
11:15:00.85 [INFO] Completed: Extracting 3 requirements to build requirements.pex from repository.pex: docker, requests, six
11:15:02.36 [INFO] Completed: Building requirements_venv.pex
11:15:04.27 [ERROR] Completed: Typecheck using MyPy - MyPy failed (exit code 1).
build-support/deploy/docker_.py:3: error: Skipping analyzing "docker": found module but no type hints or library stubs
build-support/deploy/docker_.py:3: note: See <https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports>
build-support/deploy/docker_.py:4: error: Skipping analyzing "docker.errors": found module but no type hints or library stubs
build-support/deploy/docker_.py:5: error: Skipping analyzing "docker.models.images": found module but no type hints or library stubs
Found 3 errors in 1 file (checked 6 source files)



𐄂 MyPy failed.
╭─xlevus@xd1 ~/Projects/_mono  ‹feat/isort› 
╰─➤  ./pants check ::                                                                                                                                    1 ↵
11:15:13.10 [INFO] Completed: Typecheck using MyPy - MyPy succeeded.
Success: no issues found in 18 source files



✓ MyPy succeeded.
╭─xlevus@xd1 ~/Projects/_mono  ‹feat/isort› 
╰─➤  ./pants --version
2.8.0rc6
d

dazzling-diamond-4749

11/17/2021, 10:32 PM
I think you also need
--changed-dependees=transitive
1
Not sure if thats the cause, but we have transitive set in our CI.
a

ambitious-actor-36781

11/17/2021, 10:57 PM
oh, that'd certainly help for an edge-case I've missed where updating A might break the type signatures on B. But in this case, the
.pyi
files haven't changed. And it still fails with
transitive
Will try to replicate outside of my giant turd of a project
👀 1
h

hundreds-father-404

11/17/2021, 11:39 PM
Thank you for the bug report and reproduction! I don't think I'll have a chance to get to this today, but setting a reminder for tomorrow In the meantime, I wonder if
__init__.py
without the
i
works? I definitely think our special-casing of
__init__.py
is not operating on
__init__.pyi
- pure oversight
a

ambitious-actor-36781

11/17/2021, 11:44 PM
it does not look like it
i've pushed two more commits to my repro repo
👍 1
2 Views