From bc532b95813ce5aa1b6d520993e1e915372238be Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 29 May 2023 17:10:24 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#27507: lint: stop ignoring LIEF imports 015cc5e588fa25f65f6ea2ed03701def8dfd5444 lint: stop ignoring LIEF imports (fanquake) Pull request description: Type stubs are now available as of 0.13.0. See https://github.com/lief-project/LIEF/issues/650. ACKs for top commit: TheCharlatan: ACK 015cc5e588fa25f65f6ea2ed03701def8dfd5444 Tree-SHA512: ebb754f293c2a61a0ef64c3552f7c700ceb3054b50fd3f1573e4a9e87773ddeba47bd9875f6ab055043012dbc20aeb71e4d76cd3da535c76651dfb1fbfc66e89 --- ci/lint/04_install.sh | 1 + contrib/devtools/security-check.py | 2 +- contrib/devtools/symbol-check.py | 2 +- contrib/devtools/test-security-check.py | 2 +- test/README.md | 1 + test/lint/lint-python.py | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index f7147582dc1da..737cf3e2fbf40 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -35,6 +35,7 @@ fi ${CI_RETRY_EXE} pip3 install codespell==2.2.1 ${CI_RETRY_EXE} pip3 install flake8==5.0.4 +${CI_RETRY_EXE} pip3 install lief==0.13.1 ${CI_RETRY_EXE} pip3 install mypy==0.971 ${CI_RETRY_EXE} pip3 install pyzmq==24.0.1 ${CI_RETRY_EXE} pip3 install vulture==2.6 diff --git a/contrib/devtools/security-check.py b/contrib/devtools/security-check.py index 6cd022ef1710e..452a1d42d6e10 100755 --- a/contrib/devtools/security-check.py +++ b/contrib/devtools/security-check.py @@ -10,7 +10,7 @@ import sys from typing import List -import lief #type:ignore +import lief def check_ELF_RELRO(binary) -> bool: ''' diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 3d02977217af7..178774a611bc6 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -13,7 +13,7 @@ import sys from typing import List, Dict -import lief #type:ignore +import lief # Debian 10 (Buster) EOL: 2024. https://wiki.debian.org/LTS # diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py index 54718fd7a1f84..d666291cba841 100755 --- a/contrib/devtools/test-security-check.py +++ b/contrib/devtools/test-security-check.py @@ -5,7 +5,7 @@ ''' Test script for security-check.py ''' -import lief #type:ignore +import lief import os import subprocess from typing import List diff --git a/test/README.md b/test/README.md index 2400a616b5b1c..b08be6c0a72f0 100644 --- a/test/README.md +++ b/test/README.md @@ -331,6 +331,7 @@ Use the `-v` option for verbose output. | Lint test | Dependency | |-----------|:----------:| | [`lint-python.py`](lint/lint-python.py) | [flake8](https://gitlab.com/pycqa/flake8) +| [`lint-python.py`](lint/lint-python.py) | [lief](https://github.com/lief-project/LIEF) | [`lint-python.py`](lint/lint-python.py) | [mypy](https://github.com/python/mypy) | [`lint-python.py`](lint/lint-python.py) | [pyzmq](https://github.com/zeromq/pyzmq) | [`lint-python-dead-code.py`](lint/lint-python-dead-code.py) | [vulture](https://github.com/jendrikseipp/vulture) diff --git a/test/lint/lint-python.py b/test/lint/lint-python.py index 88bbb515e6cd4..ef58ad1a0d2e5 100755 --- a/test/lint/lint-python.py +++ b/test/lint/lint-python.py @@ -13,7 +13,7 @@ import subprocess import sys -DEPS = ['flake8', 'mypy', 'pyzmq'] +DEPS = ['flake8', 'lief', 'mypy', 'pyzmq'] MYPY_CACHE_DIR = f"{os.getenv('BASE_ROOT_DIR', '')}/test/.mypy_cache" # All .py files, except those in src/ (to exclude subtrees there)