Hi everyone! I have some problems with the latest ...
# general
o
Hi everyone! I have some problems with the latest pants and python==3.12.3. During
pants tailor --check update-build-files --check ::
execution appears an error:
Copy code
[ERROR] 1 Exception encountered:

Engine traceback:
  in Update all BUILD files

ProcessExecutionFailure: Process 'Building black.pex from <resource://pants.backend.python.lint.black/black.lock>' failed with exit code 1.
stdout:

stderr:
The Pip requested was pip==23.0.1 but it does not work with the interpreter selected which is CPython 3.12.3 at /usr/bin/python3.12. Pip 23.0.1 requires Python < 3.12,>=3.7.
It seems to me that pex has its own predefined pip inside. Should I use previous python versions or is there a way to upgrade pip inside pex?
1
w
I don't have time at the moment to find this, but I ran into this the other day randomly. I think I downgraded to Python 3.11 interpreter constraints (for unrelated reasons), but I wonder if setting the latest pip would work? https://www.pantsbuild.org/2.20/reference/subsystems/python#pip_version I have not tried this yet, as I had some other 3.12 issues in one of my projects with some deps
o
I declared
pip_version = "24.0"
in pants.toml, but it didn't affect the behaviour. The same error appears:
Copy code
[ERROR] 1 Exception encountered:

Engine traceback:
  in Update all BUILD files

ProcessExecutionFailure: Process 'Building black.pex from <resource://pants.backend.python.lint.black/black.lock>' failed with exit code 1.
stdout:

stderr:
The Pip requested was pip==23.0.1 but it does not work with the interpreter selected which is CPython 3.12.3 at /usr/bin/python3.12. Pip 23.0.1 requires Python <3.12,>=3.7.
s
o
It seems like its not my case. My setup don't utilize docker and contains only
Copy code
python_sources(
    name="python",
    sources = ["**/*.py"],
    resolve = "res",
)
and
Copy code
python_requirements(
    name = "reqs",
    source = "requirements.txt",
    resolve = "res",
)
s
Yes, but you need to do the same thing, but in a different subsystem
You need to set
[black].install_from_resolve
o
Thank you, that worked
👍 1