mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge ab42b2ebdb into merged_master (Bitcoin PR bitcoin/bitcoin#28347)
This commit is contained in:
commit
fd8afcf05e
1 changed files with 6 additions and 4 deletions
|
|
@ -9,10 +9,12 @@ Check for specified flake8 and mypy warnings in python files.
|
|||
"""
|
||||
|
||||
import os
|
||||
import pkg_resources
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from importlib.metadata import metadata, PackageNotFoundError
|
||||
|
||||
|
||||
DEPS = ['flake8', 'lief', 'mypy', 'pyzmq']
|
||||
MYPY_CACHE_DIR = f"{os.getenv('BASE_ROOT_DIR', '')}/test/.mypy_cache"
|
||||
|
||||
|
|
@ -99,10 +101,10 @@ ENABLED = (
|
|||
|
||||
|
||||
def check_dependencies():
|
||||
working_set = {pkg.key for pkg in pkg_resources.working_set}
|
||||
|
||||
for dep in DEPS:
|
||||
if dep not in working_set:
|
||||
try:
|
||||
metadata(dep)
|
||||
except PackageNotFoundError:
|
||||
print(f"Skipping Python linting since {dep} is not installed.")
|
||||
exit(0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue