-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
PR: Remove usage of distutils.LooseVersion in favor of pkg_resources.parse_version #235
Conversation
qtpy/__init__.py
Outdated
@@ -62,7 +62,11 @@ | |||
""" | |||
|
|||
from distutils.version import LooseVersion | |||
try: # disutils is being deprecated | |||
import pkg_resources |
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.
this import is useless
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 kept a backup plan, as I'm not sure on what very old Python QtPy may be used.
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.
ok, but it still useless
qtpy/__init__.py
Outdated
try: # disutils is being deprecated | ||
import pkg_resources | ||
from pkg_resources import parse_version as LooseVersion | ||
except: |
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.
except ImportError:
I'd rather use the new name with the old symbol than the new symbol with the old name: use distutils.version.LooseVersion as parse_version |
@stonebig Actually, |
Hi @stonebig checking the option proposed by @CAM-Gerlach seems like a good idea but, just in case what do you think? Also, just in case, what do you think @ccordoba12 ? |
I also agree with using |
@ccordoba12 It is a setuptools-vendored dep in recent versions, but we cannot rely on the Setuptools-vendored version as it is a private, internal-only implementation detail of setuptools, varies arbitrarily between setuptools versions (some may be out of date, while some may contain breaking changes), has setuptools-specific modifications, and can change or be dropped at any time. As |
Ok, I'm fine with that. |
@stonebig You want to do that here, or would you prefer I go ahead with it (in another PR, or, at your option, on this branch)? |
Just FYI, on #234 , @bgermann suggested using the underlying QVersionNumber instead, which would presumably avoid adding a dependency and be more generic than the PEP 440-specific |
I think we can go with using the |
Sure, opened as PR #266 |
Fixes #234