pipenv
pipenv copied to clipboard
Specify Python Version Range in Pipfile
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
Only absolute values are supported, and when upgrading python versions virtualenvs need to be recreated.
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.
@Semnodime @matteius I'd love to handle this issue. I'll send a PR to fix this in near future.
@sanspareilsmyn I think I have it solved in my open PR that fixes a number of issues -- if either of you or @Semnodime can check out this branch: https://github.com/pypa/pipenv/pull/6282 and give it a whirl.