File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import attr
25
25
import py
26
- from packaging .version import Version
27
26
from pluggy import HookimplMarker
28
27
from pluggy import HookspecMarker
29
28
from pluggy import PluginManager
@@ -1059,6 +1058,9 @@ def _checkversion(self):
1059
1058
1060
1059
minver = self .inicfg .get ("minversion" , None )
1061
1060
if minver :
1061
+ # Imported lazily to improve start-up time.
1062
+ from packaging .version import Version
1063
+
1062
1064
if Version (minver ) > Version (pytest .__version__ ):
1063
1065
raise pytest .UsageError (
1064
1066
"%s:%d: requires pytest-%s, actual pytest-%s'"
Original file line number Diff line number Diff line change 9
9
from typing import Optional
10
10
from typing import TypeVar
11
11
12
- from packaging .version import Version
13
-
14
12
TYPE_CHECKING = False # avoid circular import through compat
15
13
16
14
if TYPE_CHECKING :
@@ -217,6 +215,9 @@ def importorskip(
217
215
return mod
218
216
verattr = getattr (mod , "__version__" , None )
219
217
if minversion is not None :
218
+ # Imported lazily to improve start-up time.
219
+ from packaging .version import Version
220
+
220
221
if verattr is None or Version (verattr ) < Version (minversion ):
221
222
raise Skipped (
222
223
"module %r has __version__ %r, required is: %r"
You can’t perform that action at this time.
0 commit comments