File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 13
13
from typing import Tuple , Union
14
14
15
15
16
+ def _get_dist (distribution_name : str ) -> str :
17
+ try :
18
+ # pylint: disable=import-outside-toplevel
19
+ from importlib .metadata import version # noqa: WPS433
20
+
21
+ return version (distribution_name )
22
+ except ModuleNotFoundError : # pragma: no cover
23
+ # pylint: disable=import-outside-toplevel
24
+ from pkg_resources import get_distribution # noqa: WPS433
25
+
26
+ return get_distribution (distribution_name ).version
27
+
28
+
16
29
try :
17
30
# pylint: disable=unused-import
18
31
from ._scm_version import version as __version__ # noqa: WPS433, WPS436
19
32
from ._scm_version import version_tuple as _ver_tup # noqa: WPS433, WPS436
20
- except ImportError : # pragma: no cover
21
- from importlib .metadata import version as _get_dist # noqa: WPS433
22
-
33
+ except ImportError : # pragma: no cover
23
34
__version__ = _get_dist ('proxy.py' ) # noqa: WPS440
24
35
25
36
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ deps =
262
262
pre-commit
263
263
pylint >= 2.5.3
264
264
pylint-pytest < 1.1.0
265
- pytest-mock > = 3.6.1
265
+ pytest-mock = = 3.6.1
266
266
-r docs/requirements.in
267
267
-r requirements-tunnel.txt
268
268
-r requirements-testing.txt
You can’t perform that action at this time.
0 commit comments