Hi all. Was about to post a troubleshooting questi...
# general
w
Hi all. Was about to post a troubleshooting question and then resolved my problem, so I think I'll post the resolution instead in case it helps someone. I'm setting up a relatively new Python monorepo with a Pants build and got the point of generating lockfiles. The
pants generate-lockfiles
command met an exception:
Copy code
10:41:41.12 [ERROR] 1 Exception encountered:

Engine traceback:
  in `generate-lockfiles` goal

ProcessExecutionFailure: Process 'Generate lockfile for python-default' failed with exit code 1.
stdout:

stderr:
Invalid specifier: 'CPython>=3.11.*'
I couldn't find any place that CPython was being specified in my requirements or Pant configuration, so I was initially stumped. Then I looked at my
interpreter_contraints
in pants.toml and saw I had this:
Copy code
interpreter_constraints = [">=3.11.*"]
I realized that I wanted to pin that to an exact minor version of Python thus:
Copy code
interpreter_constraints = ["==3.11.*"]
... and when I did so it resolved the issue with
generate-lockfiles
. Hurray! Alas, I did find the solution more or less by accident, so if this prompts anyone to think about a better error message it probably would be helpful.
h
Thanks for posting!