I'm trying to run ```pants --keep-sandboxes=on_fai...
# general
p
I'm trying to run
Copy code
pants --keep-sandboxes=on_failure generate-lockfiles --generate-lockfiles-resolve=python-udf-explanatory-prediction
but hitting this (package is in a private repo)
Copy code
ERROR: Ignored the following versions that require a different python version: 0.1.0 Requires-Python >=3.11,<3.12; 0.1.1 Requires-Python >=3.11,<3.12; 0.1.2 Requires-Python >=3.11,<3.12
ERROR: Could not find a version that satisfies the requirement explanatory-model<0.2.0,>=0.1.2 (from versions: none)
pants.toml
Copy code
[GLOBAL]
pants_version = "2.21.0"

...

[python]
enable_resolves = true
interpreter_constraints = ['>=3.11']
BUILD
Copy code
__defaults__(all=dict(resolve="python-udf-explanatory-prediction"))

poetry_requirements(
    name="poetry",
)

python_aws_lambda_function(
    name="lambda",
    runtime="python3.11",
    handler="udf_explanatory_prediction/main.py:lambda_handler",
    dependencies=[
        "udf-explanatory-prediction/udf_explanatory_prediction:udf_explanatory_prediction",
    ],
)
pyproject.toml
Copy code
[tool.poetry]
name = "udf-explanatory-prediction"
version = "0.1.0"
description = "..."
authors = ["..."]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.11,<4"
explanatory-model = {version = "^0.1.2", source = "data"}

[[tool.poetry.source]]
name = "data"
url = "https://.../pypi/data/simple/"
priority = "supplemental"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
udf_explanatory_prediction/BUILD
Copy code
python_sources(
  dependencies=["udf-engagement-explanatory-prediction:poetry"],
)

python_tests(
    name="tests",
)
1
c
your interpreter constraints
interpreter_constraints = ['>=3.11']
is not compatible with those of
explanatory-model
using
>=3.11,<3.12
. That is, yours are open ended, rather than capped with
<3.12
.
p
Nope, much more insidious. I switched from repo-hosted to a local file to iterate over attempts quicker and the error message changed
Copy code
[tool.poetry.dependencies]
python = ">=3.9"
#explanatory-model = {version = "0.1.4", source = "data"}
explanatory-model = { path = "./explanatory_model-0.1.4-py3-none-any.whl" }
then
Copy code
ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 1.25.0 Requires-Python >=3.9; 1.25.0rc1 Requires-Python >=3.9; 1.25.1 Requires-Python >=3.9; 1.25.2 Requires-Python >=3.9; 1.26.0 Requires-Python <3.13,>=3.9; 1.26.0b1 Requires-Python <3.13,>=3.9; 1.26.0rc1 Requires-Python <3.13,>=3.9; 1.26.1 Requires-Python <3.13,>=3.9; 1.26.2 Requires-Python >=3.9; 1.26.3 Requires-Python >=3.9; 1.26.4 Requires-Python >=3.9; 1.7.0 Requires-Python >=3.9.0; 1.8.0 Requires-Python >=3.9.0; 2.0.0 Requires-Python >=3.9; 2.0.0b1 Requires-Python >=3.9; 2.0.0rc1 Requires-Python >=3.9; 2.0.0rc2 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement numpy==1.26.4 (from explanatory-model) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 1.22.4, 1.23.0rc1, 1.23.0rc2, 1.23.0rc3, 1.23.0, 1.23.1, 1.23.2, 1.23.3, 1.23.4, 1.23.5, 1.24.0rc1, 1.24.0rc2, 1.24.0, 1.24.1, 1.24.2, 1.24.3, 1.24.4)
ERROR: No matching distribution found for numpy==1.26.4
So problem with numpy, scikit-learn, shap transitives Are these ML libraries packaged specially (I seem to remember that being required)?
I think there's an issue when multiple package versions are tried (by pip?) the error messages are compacted/swallowed
I have no idea why but the only change needed was changing the package
>=3.11,<4
and leaving the ranges open ended on the pants side. I left the
interpreter_constraints
open so individual projects can pick their versions with pyproject.toml which seems to work (they're in different resolves). In general, I was trying to avoid constraining Python anywhere except the source module since we control that version (and let everything downstream resolve something that works)
c
happy you got it resolved. It just shows how unintuitive this whole business is. I've seen numerous occasions where the ICs been the culprit, alas, that must've been in a slightly different way then.. 🤷 😛
p
I couldn't even reproduce the problem--I think maybe I hit some weird issue with cache where I had a bad version constraint somewhere and fixed it but ran into some stale cache issues