hundreds-carpet-28072
01/11/2024, 2:10 PMblack==23.9.1
. It’s then failing to run the cached Pex for this tool. It shouldn’t be attempting to use 3.7, do I need to update from 2.16 or include more specific resolves? Relevant parts of my pants.toml
look like this:
[GLOBAL]
pants_version = "2.16.0"
backend_packages = [
"pants.backend.build_files.fmt.black",
"pants.backend.python.providers.experimental.pyenv"
]
[python]
interpreter_constraints = ["CPython>=3.9.*"]
[python-bootstrap]
search_path = ["/usr/bin", "<PYENV>"]
[black]
version = "black==23.9.1"
It seems to be including a python_version < 3.10
requirement from somewhere but from where I am unsure.
Error output in thread…hundreds-carpet-28072
01/11/2024, 2:11 PM% pants fix ::
18:20:11.76 [INFO] Completed: Building black.pex with 2 requirements: black==23.9.1, typing-extensions>=3.10.0.0; python_version < "3.10"
18:20:11.76 [ERROR] 1 Exception encountered:
Engine traceback:
in `fix` goal
ProcessExecutionFailure: Process 'Building black.pex with 2 requirements: black==23.9.1, typing-extensions>=3.10.0.0; python_version < "3.10"' failed with exit code 1.
stdout:
stderr:
pid 99022 -> pip_cache --log /private/var/folders/r4/fkll0nt120xf9zwh29r1r6zm0000gq/T/pants-sandbox-5QELmO/.tmp/pex-pip-log.msq_pzq3/pip.log download --dest /Users/<user>/.cache/pants/named_caches/pex_root/downloads/resolver_download.z8re_2ou/<user>..pyenv.versions.3.7.13.bin.python3.7 black==23.9.1 typing-extensions>=3.10.0.0; python_version < "3.10" --index-url <https://pypi.python.org/simple> --retries 5 --timeout 15 exited with 1 and STDERR:
ERROR: Could not find a version that satisfies the requirement black==23.9.1
ERROR: No matching distribution found for black==23.9.1
curved-manchester-66006
01/11/2024, 2:48 PMblack
and pyenv
in the example-python repo that I think is along the lines of what you are trying to do
git diff requirements.txt pants.toml | cat
diff --git a/pants.toml b/pants.toml
index dfb564f..6ef4a19 100644
--- a/pants.toml
+++ b/pants.toml
@@ -11,6 +11,7 @@ backend_packages.add = [
"pants.backend.python.lint.flake8",
"pants.backend.python.lint.isort",
"pants.backend.python.typecheck.mypy",
+ "pants.backend.python.providers.experimental.pyenv"
]
[anonymous-telemetry]
@@ -21,6 +22,7 @@ repo_id = "3B1D361B-E9F1-49A8-B761-03DCC41FD58E"
# The Python source root is the repo root. See <https://www.pantsbuild.org/docs/source-roots>.
root_patterns = ["/"]
+
[python]
# The default interpreter constraints for code in this repo. Individual targets can override
# this with the `interpreter_constraints` field. See
@@ -48,3 +50,9 @@ search_path = ["<PATH>", "<PYENV>"]
[python-infer]
# 2.17 is transitioning to a new, faster parser for dependency inference:
use_rust_parser = true
+
+
+[black]
+#install_from_resolve = "pytest"
+requirements =["//:reqs#black"]
+interpreter_constraints = ["==3.9.*"]
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index 979167d..043ea20 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,8 @@
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
+black==23.9.1
ansicolors==1.1.8
setuptools>=56.2.0,<57
types-setuptools>=56.2.0,<58
-pytest==7.1.3
\ No newline at end of file
+pytest==7.1.3
hundreds-carpet-28072
01/11/2024, 2:53 PM[black]
interpreter_constraints = ["==3.9.*"]
…looks to be the relevant bit, but I’m interested in why it’s being resolved to 3.7 in my users’ setup.hundreds-carpet-28072
01/11/2024, 2:54 PMcoverage
tool rather than blackcurved-manchester-66006
01/11/2024, 3:02 PM--coverage-py-interpreter-constraints="['<str>', '<str>', ...]"
PANTS_COVERAGE_PY_INTERPRETER_CONSTRAINTS
interpreter_constraints
default: [
"CPython>=3.7,<4"
]
current value: [
"CPython>=3.7,<4"
]
Python interpreter constraints for this tool.
This is all with the pyenv backend right?hundreds-carpet-28072
01/11/2024, 3:27 PMpants fmt ::
) who isn’t using the pyenv backend but does have pyenv installed (w/ 3.10 and 3.11 interpreters installed).
I’m assuming it’s installing the minimum interpreter required based on constraints for these tools? But then unsure why it’s failing to run them?hundreds-carpet-28072
01/11/2024, 3:28 PM