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

curved-television-6568

11/14/2022, 3:31 PM
I’m looking into a lockfile issue that’s more annoying than anything else, but any insights appreciated. 🧵
1
We occasionally see this error:
Copy code
pants.core.util_rules.lockfile_metadata.InvalidLockfileError: You are using the lockfile at 3rdparty/python/lockfiles/mypy.txt to install the tool `mypy`, but it is not compatible with your configuration:

- You have set different requirements than those used to generate the lockfile. You can fix this by updating `[mypy].version`, `[mypy].source_plugins`, and/or `[mypy].extra_requirements`, or by using a new custom lockfile.
In the lockfile, but not in the input requirements: ['pytest==5.4.3']

To regenerate your lockfile based on your current configuration, run `./pants generate-lockfiles --resolve=mypy`.
Now begs the question why this
pytest
requirement seems to be coming and going, as if we regenerate the mypy lockfile, the issue goes away, but then it comes back sometimes after we regenerate the lockfile for pyhon-default.. I’ve not yet figured out the exact pattern, but if anyone recognizes this issue.. ?
(another question is if it should be a hard error when there’s an additional unused input in the lockfile rather than a missing one?)
OK, found it. It was a
[mypy].source_plugins
entry that points to code that pulled in
pytest
irrationally..
👍 1
3 Views