brash-baker-91190
05/24/2022, 3:36 PMpants.toml
, I have:
[python]
interpreter_constraints = [">=3.8,<4"]
[python-bootstrap]
search_path = ["<PYENV_LOCAL>", "<PYENV>", "<PATH>"]
My .python-version
file has 3.8.13
.
My black
configuration is:
[black]
lockfile = "3rdparty/python/black.lockfile"
version = "black>=22.3.0"
config = "pyproject.toml"
and black.lockfile
contains the following metadata:
// --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
// {
// "version": 2,
// "valid_for_interpreter_constraints": [
// "CPython<4,>=3.8"
// ],
// "generated_with_requirements": [
// "black>=22.3.0",
// "typing-extensions>=3.10.0.0; python_version < \"3.10\""
// ]
// }
// --- END PANTS LOCKFILE METADATA ---
When I run ./pants fmt ::
, black
runs fine. However, when I run ./pants update-build-files
, I get the following error:
11:33:26.58 [ERROR] 1 Exception encountered:
InvalidLockfileError: You are using the lockfile at 3rdparty/python/black.lockfile to install the tool `black`, but it is not compatible with your configuration:
- You have set interpreter constraints (`CPython<4,>=3.7`) that are not compatible with those used to generate the lockfile (`CPython<4,>=3.8`). You can fix this by not setting `[black].interpreter_constraints`, or by using a new custom lockfile.
To regenerate your lockfile based on your current configuration, run `./pants generate-lockfiles --resolve=black`.
Why would black
work in one instance but not the other, and where might that >=3.7
constraint be coming from? Thanks in advance!hundreds-father-404
05/24/2022, 3:39 PMbrash-baker-91190
05/24/2022, 3:44 PMhundreds-father-404
05/24/2022, 3:58 PMhundreds-father-404
05/24/2022, 4:35 PMupdate-build-files
with either tailor
or fmt
(likely soon-to-be-called fix
) 🙂 https://docs.google.com/document/d/1lpW2qGmhhT4Um6uGHRcpxwsseA7oxH86FE2L2gfBYWU/edit#heading=h.dfo4k0ltaodyhundreds-father-404
05/24/2022, 11:42 PM