Hey folks! I’m working on a bugfix and am trying t...
# development
b
Hey folks! I’m working on a bugfix and am trying to test my changes locally by running Pants from source against my own repo, as outlined here: https://www.pantsbuild.org/v2.17/docs/running-pants-from-sources But when I run pants like this:
Copy code
PANTS_SOURCE=../../pants pants check ::
I get the following error:
Copy code
InvalidLockfileError: You are consuming `Scrapy<3.0.0,>=2.6.1`, `alembic<2.0.0,>=1.11.1`, and 44 other requirements from the `python-default` lockfile at 3rdparty/python/default.lock with incompatible inputs.



- The inputs use interpreter constraints (`CPython==3.9.*`) that are not a subset of those used to generate the lockfile (`CPython<3.11,>=3.10`).
But the thing is, I already changed the
pants.toml
file in the pants repo to use Python 3.10 as well as the dependent files outlined in the comment:
Copy code
[python]
# N.B.: When upgrading to a new Python version, you must update the Pants
# `python_distribution` targets, currently:
# + src/python/pants:pants-packaged
# + src/python/pants/testutil:testutil_wheel
# And update the PythonBuildStandalone version/URL:
# + src/python/pants/core/subsystems/python_bootstrap.py
interpreter_constraints = ["CPython==3.10.*"]
Did I miss something here?
b
I bet there's more work that has to be done, likely for
scie-pants
or other lockfiles/places 🤔
b
Ah okay, thanks. By any chance, would you happen to know what that work is / where I might start to look?
b
I think you'd need to re-run
generate-lockfiles
in the Pants repo with the default resolve?
So
./pants generate-lockfiles --resolve=python-default
b
Okay thanks, that was helpful. What’s interesting is that no matter what I change in
pants.toml
, the lockfile always comes out with this:
Copy code
//   "valid_for_interpreter_constraints": [
//     "CPython==3.9.*"
//   ],
So I don’t know where the Python version for the lockfile is being controlled from, but I’ll try to find it
b
Ah maybe look into
build-support/bin/generate_builtin_lockfiles.py
?
b
I’ll try this on a Linux machine instead, that should help