Re: <Mypy third party type stubs>. How can I ensur...
# general
b
Re: Mypy third party type stubs. How can I ensure these versions are consistent with my normal resolve versions?
h
what do you mean?
b
It seems
types-*
packages follow the versions of their corresponding package. What's the preferred way to ensure they get bumped in lockstep? E.g. if I bump my resolve and
requests
changes version, my
types-requests
should mirror that
h
Ah, you mean third-party published stubs. I was thinking of first-party stubs you write for third-party code I don't think Pants has any party tricks here. I think it comes down to how you update your top-level
python_requirement
targets, e.g.
requirements.txt
. Maybe group the two together and add a comment to bump both
b
We end up abusing
source_plugins
to point to normal requirements that are pulled in via
python_requirements
, so that at least all the versions are specified in one place (poetry, which is exported to a
requirements.txt
to have fully pinned versions), instead of stubs/plugins in
pants.toml
and main libs in `BUILD`/`requirements.txt` https://github.com/pantsbuild/pants/issues/16044 (That said, this only solves one tiny part of the issue, and not really much about stubs themselves... since the stubs and lib versions might be bumped out of sync and/or end up with different versions in different lockfiles.)
b
Looking at
types-requests==2.28.11.5
you'd hope the
METADATA
would declare
Requires-Dist: requests >= 2.28.11
but no 😮‍💨