How do you add mypy stubs nowadays? `extra_type_st...
# general
a
How do you add mypy stubs nowadays?
extra_type_stubs
is gone now, and if you just add them to the requirements for mypy, they don't get added to the
requirements_venv
that gets used to run mypy with (whereas, in 2.17, the version we're on,
extra_type_stubs
gets installed there).
a
We don't use infer, and the bit about adding them to the mypy custom lockfile doesn't work. The mypy.pex has those, but it's using requirements_venv.pex to run mypy, which in 2.17 contained the extra_type_stubs, but doesn't in 2.20
I think this is probably a bug, as the documentation implies we should be able to do this, but it doesn't work like this.
m
Also encountering the same issue, wondering if you've figured out a solution yet
a
Nope, I'm still stuck in resolve hell, so we haven't upgraded, but the solution is to just add them to the requirements of everything 😞
😢 1
m
thanks! I also did that in my python package monorepo but it's not an ideal solution because now the packages will include all the type stubs in their dependencies
a
Yeah, for us it's even worse since we don't have a library that everything depends on.
I mean, it's not the end of the world if they get deployed, but it's just... meh. And, personally, I think having to put stubs for every package is just noise, just install all of them all the time, it's not that many that need them.
m
yeah it's just very annoying
a
So we ended up with the same 'all stubs all the time', just in a more complicated way
👍 1
m
there's a related github issue: https://github.com/pantsbuild/pants/issues/21114 hopefully it can be addressed soon. for now I might have to write my own plugin as a workaround
a
That's my issue 😄
😆 1
And the resolution was "we'll fix the docs"
😢 1