Hi all, when working with Python, why can't pants ...
# general
g
Hi all, when working with Python, why can't pants solve some of the newer versions of the requirements? E.g. Given the simplified requirements file
numpy==1.24.3 ; python_version >= "3.11" and python_version < "4.0"
pants
generate-lockfiles
fails with
ERROR: Could not find a version that satisfies the requirement numpy==1.24.3
but if I lower the numpy version to e.g.
1.15.0
it works ok
w
what are your interpreter_constraints?
g
I have none specified
e
So they default to
>=3.7,<4
which won't work since numpy 1.24.3 is
>=3.8
❤️ 1
w
(upcoming versions of Pants remove that default! pheew.)
@great-appointment-89710 why in particular do you care about
python_version >= "3.11" and python_version < "4.0"
? Do you only want numpy for 3.11 but not 3.10 or something? That seems like a strange requirement.
g
That came from exporting requirements from poetry, as I wanted to test that the version resolution also failed if I used a requirements.txt instead of pyproject.toml
Thanks both, that worked well 🙂 FYI I first made the mistake of setting the constraints as a string instead of a list, neither
tailor
nor
generate-lockfiles
complained about it, but the change didn't make effect either