PR: Remove usage of distutils.LooseVersion in favor of pkg_resources.parse_version#235
PR: Remove usage of distutils.LooseVersion in favor of pkg_resources.parse_version#235stonebig wants to merge 3 commits intospyder-ide:masterfrom
Conversation
qtpy/__init__.py
Outdated
|
|
||
| from distutils.version import LooseVersion | ||
| try: # disutils is being deprecated | ||
| import pkg_resources |
There was a problem hiding this comment.
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.
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: |
|
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