Is anyone experiencing that typecheck (mypy) fails...
# general
r
Is anyone experiencing that typecheck (mypy) fails due to missing
types-six
whenever switching branches or in CI like GitHub Actions? This seems to be resolved if I run the same operation twice, but becoming annoying as CI also suffers from the same issue. (I'm using Pants 2.16.0dev5) Maybe some
pex
issue?
h
Hmm, that is odd
can you post a simple example repo to github that reproduces this?
And how are you running the typecheck? What is your Pants command?
And what error are you getting?
r
./pants check ::
These errors disappear if I rerun the job
of course I have an explicit external dependency to
types-six
should I put it on
extra_requirements
of
pants.toml
(https://github.com/lablup/backend.ai/blob/main/pants.toml#L113) ?
just running the command (
./pants check --changed-since=main
via the git pre-push hook) twice makes it disappearing...
hmmmm I suspect that this happens almost surely when I have two different pantsd running simultaneously on different directories of the checkouts of different branches of the same repo.
h
Hmm, two different checkouts should appear to Pants like two unrelated repos, so I'd be surprised if that were the issue. Can you isolate a reproduction?
r
It's hard because whenever I re-run the last command, it disappears...
b
dev5 doesn't include this bugfix: https://github.com/pantsbuild/pants/pull/18043
👀 1
So, Pants bug. Also my bad 😅 Try
dev6
?
❤️ 1
r
Ah, that might be the cause! I'll try!
it seems to be fixed in my local setup, at least
hmmmm it happened again even with dev7... T_T
trying to bust all pants-related cache..
b
There might be a mypy option for disabling the cache. Might be worth starting there
r
I'm now trying https://github.com/lablup/backend.ai/pull/1107
extra_type_stubs
and
extra_type_stubs_lockfile
...
s
So far it seems that adding the
extra_type_stubs
in the
pants.toml
did the trick, and it’s worth pinning the versions of you extra_types_stubs in the config. I’m surprised though, as it looks like the stubs specified in the different dependencies universes would never be used by
mypy
: how to specify different stubs version for different package versions? For example yesterday, a new version of the pandas-stubs has been released and caused errors to appear (most likely because of the pre-release of
pandas==2.0.0rc0
). Let’s image I want to have 2 resolves with different pandas versions for which the stubs are not compatible, how shall I proceed?