Merge pull request #4379 from hoylemd/improve_minversion_again
Use packaging/pkg_resources to check minversion
This commit is contained in:
commit
45c33c4e05
1
AUTHORS
1
AUTHORS
|
@ -158,6 +158,7 @@ Michael Droettboom
|
|||
Michael Seifert
|
||||
Michal Wajszczuk
|
||||
Mihai Capotă
|
||||
Mike Hoyle (hoylemd)
|
||||
Mike Lundy
|
||||
Miro Hrončok
|
||||
Nathaniel Waisbrot
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.
|
|
@ -11,10 +11,10 @@ import shlex
|
|||
import sys
|
||||
import types
|
||||
import warnings
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import py
|
||||
import six
|
||||
from pkg_resources import parse_version
|
||||
from pluggy import HookimplMarker
|
||||
from pluggy import HookspecMarker
|
||||
from pluggy import PluginManager
|
||||
|
@ -822,7 +822,7 @@ class Config(object):
|
|||
|
||||
minver = self.inicfg.get("minversion", None)
|
||||
if minver:
|
||||
if LooseVersion(minver) > LooseVersion(pytest.__version__):
|
||||
if parse_version(minver) > parse_version(pytest.__version__):
|
||||
raise pytest.UsageError(
|
||||
"%s:%d: requires pytest-%s, actual pytest-%s'"
|
||||
% (
|
||||
|
|
Loading…
Reference in New Issue