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

bitter-ability-32190

12/01/2022, 8:18 PM
Re: Mypy third party type stubs. How can I ensure these versions are consistent with my normal resolve versions?
h

hundreds-father-404

12/01/2022, 8:20 PM
what do you mean?
b

bitter-ability-32190

12/01/2022, 8:21 PM
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

hundreds-father-404

12/01/2022, 8:23 PM
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

broad-processor-92400

12/01/2022, 9:38 PM
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

bitter-ability-32190

12/01/2022, 9:44 PM
Looking at
types-requests==2.28.11.5
you'd hope the
METADATA
would declare
Requires-Dist: requests >= 2.28.11
but no 😮‍💨
3 Views