We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9273f6 commit 6c008a2Copy full SHA for 6c008a2
test/lint/lint-python.py
@@ -9,10 +9,12 @@
9
"""
10
11
import os
12
-import pkg_resources
13
import subprocess
14
import sys
15
+from importlib.metadata import metadata, PackageNotFoundError
16
+
17
18
DEPS = ['flake8', 'lief', 'mypy', 'pyzmq']
19
MYPY_CACHE_DIR = f"{os.getenv('BASE_ROOT_DIR', '')}/test/.mypy_cache"
20
@@ -99,10 +101,10 @@
99
101
100
102
103
def check_dependencies():
- working_set = {pkg.key for pkg in pkg_resources.working_set}
-
104
for dep in DEPS:
105
- if dep not in working_set:
+ try:
106
+ metadata(dep)
107
+ except PackageNotFoundError:
108
print(f"Skipping Python linting since {dep} is not installed.")
109
exit(0)
110
0 commit comments