pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.73k stars 1.86k forks source link

Specify Python Version Range in Pipfile #6144

Open Semnodime opened 2 months ago

Semnodime commented 2 months ago

Issue description

[requires]
python_version = ">=3.12"

Expected result

Choose the latest python version available on the system to satisfy the constraints or raise the constraint error.

Actual result

Warning: Python >=3.12 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.

Steps to replicate

pipenv --python 3.12
# Change last line in Pipfile to `python_version = ">=3.12"`
pipenv --rm
pipenv --install
matteius commented 2 months ago

Only absolute values are supported, and when upgrading python versions virtualenvs need to be recreated.

Semnodime commented 2 months ago

Only absolute values are supported, and when upgrading python versions virtualenvs need to be recreated.

Correct. That's what I observed. This is a bug since the rest of the Pipfile uses the same version specifiers and pipenv --install does not communicate that only absolute values are supported and a range has been specified. I acknowledge that one could conclude that from the pipenv error, but IMHO it'd be better to signal this parsing constraint explicitly along the error message.

sanspareilsmyn commented 1 month ago

@Semnodime @matteius I'd love to handle this issue. I'll send a PR to fix this in near future.