-
Notifications
You must be signed in to change notification settings - Fork 555
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
Allow Python versions with letters in the minor version suffix #82
Conversation
This would probably be simpler handled with the |
In other words, versions like import packaging.version
v1 = packaging.version.Version("3.9.0+") # <- raises InvalidVersion
v2 = packaging.version.Version("3.8.0")
v1 < v2 |
@@ -34,7 +35,7 @@ | |||
|
|||
_PY_VERSION: str = sys.version.split()[0] | |||
|
|||
if tuple(int(i) for i in _PY_VERSION.split(".")) < (3, 8, 0): | |||
if packaging.version.Version(_PY_VERSION) < packaging.version.Version("3.8.0"): |
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.
With that raising an InvalidVersion
error, wouldn't it just crash and make the library unusable for someone in the position of #27?
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.
I'm trying to check how to handle this properly with poetry returning invalid versions but their website seems to be down with ERR_SSL_PROTOCOL_ERROR
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.
With that raising an
InvalidVersion
error, wouldn't it just crash and make the library unusable for someone in the position of #27?
Yes it would exclude "3.9.0+". However, the packaging package claims to implement PEP 440. And according to PEP 440 "3.9.0+" is not a valid version (due to the "+" suffix).
The previous regex proposal could process "3.9.0anything123too".
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.
I'm trying to check how to handle this properly with poetry returning invalid versions but their website seems to be down with
ERR_SSL_PROTOCOL_ERROR
yesterday pypi.org had an CDN outage no pip install)
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.
I could add .rstrip("+")
as done in https://github.com/huggingface/huggingface_hub/pull/27/files
i.e. _PY_VERSION: str = sys.version.split()[0].rstrip("+")
It seems that @ericricky isn't active rn.
Include changes made in #27
@@ -32,9 +33,9 @@ | |||
|
|||
logger = logging.getLogger(__name__) | |||
|
|||
_PY_VERSION: str = sys.version.split()[0] | |||
_PY_VERSION: str = sys.version.split()[0].rstrip("+") |
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.
@LysandreJik I added the proposal made by @ericricky
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.
Yes, LGTM!
Could you run |
see also #27