-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle unsupported python versioning on Pipfile #6164
Handle unsupported python versioning on Pipfile #6164
Conversation
7daf34d
to
b2dafaa
Compare
e6fbda8
to
ad77f63
Compare
pipenv/utils/virtualenv.py
Outdated
if python: | ||
range_pattern = r"^[<>]=?|!=" | ||
if re.search(range_pattern, python): | ||
click.echo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have been migrating away from click.echo to use the rich console -- you can find other examples in the code of how to print the equivalent thing using that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matteius Thanks for guidance. I'll check and modify it to the convention.
pipenv/utils/virtualenv.py
Outdated
), | ||
err=True, | ||
) | ||
abort() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe abort
is fine, not sure how it behaves different then the other runtime errors we raise--just calling out this is an uncommon pattern in the project so deserves additional thought to standardize on a best approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matteius I'll think about it more about how to handle the runtime errors in another ways. It would be glad for me for you to recommend some references if it's available!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about sys.exit(1)
? That is what I am using in my PR to clean up and not render a stack error trace when resolver fails.
The issue
This is a bug fix of Pipfile [requires] regards to #6144
Pipenv only supports absolute python version. If the user specifies a Python version with inequality signs like >=3.12, <3.12 in the [requires] field, the code has been modified to explicitly express in an error log that absolute versioning must be used.
The fix
The checklist
news/
directory to describe this fix with the extension.bugfix.rst
,.feature.rst
,.behavior.rst
,.doc.rst
..vendor.rst
. or.trivial.rst
(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.