blob: a9736bc11169a0b471772600d7b26a71f1d35b7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
don't use obsolete pkg_resources
partially from PR https://github.com/nvbn/thefuck/pull/1558
see https://bugs.gentoo.org/971648
--- a/setup.py
+++ b/setup.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
-import pkg_resources
+from importlib.metadata import version as get_version, PackageNotFoundError
import sys
import os
import fastentrypoints
try:
- if int(pkg_resources.get_distribution("pip").version.split('.')[0]) < 6:
+ if int(get_version("pip").split('.')[0]) < 6:
print('pip older than 6.0 not supported, please upgrade pip with:\n\n'
' pip install -U pip')
sys.exit(-1)
-except pkg_resources.DistributionNotFound:
+except PackageNotFoundError:
pass
if os.environ.get('CONVERT_README'):
|