enough-analyst-54434
01/19/2021, 6:58 PM$ cat BUILD.nate
python_requirement_library(
name="foo",
requirements=["boto3==1.15.6", "botocore"],
)
$ ./pants repl //:foo
10:55:21.20 [WARN] The constraints file 3rdparty/python/constraints.txt does not contain entries for the following requirements: botocore, boto3
10:55:21.20 [WARN] Ignoring resolve_all_constraints setting in [python_setup] scope because constraints file does not cover all requirements.
10:56:23.37 [INFO] Completed: Building requirements.pex with 2 requirements: boto3==1.15.6, botocore
10:56:23.37 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
...
pants.engine.process.ProcessExecutionFailure: Process 'Building requirements.pex with 2 requirements: boto3==1.15.6, botocore' failed with exit code 1.
stdout:
stderr:
ERROR: Cannot install botocore==1.18.10, botocore==1.18.11, botocore==1.18.12, botocore==1.18.13, botocore==1.18.14, botocore==1.18.15, botocore==1.18.16, botocore==1.18.17, botocore==1.18.18, botocore==1.18.6, botocore==1.18.7, botocore==1.18.8 and botocore==1.18.9 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies>
pid 152051 -> /usr/bin/python3.7 /home/jsirois/.cache/pants/named_caches/pex_root/pip.pex/1b2dfe434f773fd6aaf45cdd941bad0c262b8e13 --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /home/jsirois/.cache/pants/named_caches/pex_root download --dest /tmp/process-executionYHMAYe/.tmp/tmp10y30qf9/usr.bin.python3.7 --constraint 3rdparty/python/constraints.txt boto3==1.15.6 botocore --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
None
At a baseline we should see the same error and we don'thundreds-father-404
01/19/2021, 6:58 PMhelpful-lunch-92084
01/19/2021, 7:13 PMhelpful-lunch-92084
01/19/2021, 7:22 PMdiff --git i/pants.toml w/pants.toml
index d126e7465..704833905 100644
--- i/pants.toml
+++ w/pants.toml
@@ -60,8 +60,8 @@ root_patterns = [
[python-setup]
resolver_version = "pip-2020-resolver"
-requirement_constraints = "3rdparty/python/constraints.txt"
-resolve_all_constraints = "nondeployables"
+#requirement_constraints = "3rdparty/python/constraints.txt"
+#resolve_all_constraints = "nondeployables"
interpreter_constraints = [">=3.7,<3.9"]
[black]
To fix my error i had to change our interpreter_constraints. Due to our codebase still having some py2 code we still need to set a global interpreter_constraints to py2/py3. And apparently the pip resolver stuff doesn’t work when executing with py2, which pants chooses by default since it’s the min version.helpful-lunch-92084
01/19/2021, 7:23 PMdiff --git i/pants.toml w/pants.toml
index d126e7465..d90925960 100644
--- i/pants.toml
+++ w/pants.toml
@@ -60,9 +60,9 @@ root_patterns = [
[python-setup]
resolver_version = "pip-2020-resolver"
-requirement_constraints = "3rdparty/python/constraints.txt"
-resolve_all_constraints = "nondeployables"
-interpreter_constraints = [">=3.7,<3.9"]
+#requirement_constraints = "3rdparty/python/constraints.txt"
+#resolve_all_constraints = "nondeployables"
+interpreter_constraints = ["~=2.7", ">=3.7,<3.9"]
[black]
config = "pyproject.toml"
helpful-lunch-92084
01/19/2021, 7:27 PM$ pex --python-path=~/.pyenv/versions/2.7.17/bin boto3==1.15.6 botocore -o boto3.pex
Failed to resolve compatible distributions:
1: boto3==1.15.6 requires botocore<1.19.0,>=1.18.6 but botocore 1.19.56 was resolved
helpful-lunch-92084
01/19/2021, 7:28 PMhelpful-lunch-92084
01/19/2021, 7:29 PMhelpful-lunch-92084
01/19/2021, 7:52 PMhelpful-lunch-92084
01/19/2021, 7:52 PMenough-analyst-54434
01/19/2021, 7:54 PMenough-analyst-54434
01/19/2021, 7:55 PMhelpful-lunch-92084
01/19/2021, 7:57 PM--use-feature=2020-resolver
to the PIP_2020 line here: https://github.com/pantsbuild/pex/blob/master/pex/pip.py#L45helpful-lunch-92084
01/19/2021, 7:58 PMenough-analyst-54434
01/19/2021, 8:06 PMenough-analyst-54434
01/19/2021, 8:07 PM$ pip --use-feature=2020-resolver debug
WARNING: --use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0.
enough-analyst-54434
01/19/2021, 8:09 PMDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. ...
warning. So warning squelching will be in order on top of the simple fix.enough-analyst-54434
01/19/2021, 8:11 PMhelpful-lunch-92084
01/19/2021, 8:12 PMenough-analyst-54434
01/19/2021, 8:13 PM