Merge pull request #4379 from hoylemd/improve_minversion_again

Use packaging/pkg_resources to check minversion
This commit is contained in:
Ronny Pfannschmidt 2018-11-19 21:38:45 +01:00 committed by GitHub
commit 45c33c4e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -158,6 +158,7 @@ Michael Droettboom
Michael Seifert
Michal Wajszczuk
Mihai Capotă
Mike Hoyle (hoylemd)
Mike Lundy
Miro Hrončok
Nathaniel Waisbrot

View File

@ -0,0 +1 @@
Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.

View File

@ -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'"
% (