mirror of
https://github.com/mandiant/capa.git
synced 2025-12-05 20:40:05 -08:00
Add deptry support (#2085)
* Add deptry support This commit resolves #1497. Note: known_first_party refers to modules that are supposed to be local, i.e. idaapi, ghidra, java, binaryninja, ... etc. * adjust running stages for deptry hook * adjust deptry exclusions, and humanize dependency --------- Co-authored-by: Soufiane Fariss <soufiane.fariss@um5s.net.ma>
This commit is contained in:
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -46,6 +46,8 @@ jobs:
|
||||
run: pre-commit run flake8 --hook-stage manual
|
||||
- name: Check types with mypy
|
||||
run: pre-commit run mypy --hook-stage manual
|
||||
- name: Check imports against dependencies
|
||||
run: pre-commit run deptry --hook-stage manual
|
||||
|
||||
rule_linter:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
@@ -127,3 +127,13 @@ repos:
|
||||
- "--ignore=tests/test_scripts.py"
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: deptry
|
||||
name: deptry
|
||||
stages: [push, manual]
|
||||
language: system
|
||||
entry: deptry .
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
- ci: update github workflows to use latest version of actions that were using a deprecated version of node #1967 #2003 capa-rules#883 @sjha2048 @Ana06
|
||||
- ci: update binja version to stable 4.0 #2016 @xusheng6
|
||||
- ci: update github workflows to reflect the latest ghidrathon installation and bumped up jep, ghidra versions #2020 @psahithireddy
|
||||
- add deptry support #1497 @s-ff
|
||||
|
||||
### Raw diffs
|
||||
- [capa v7.0.1...master](https://github.com/mandiant/capa/compare/v7.0.1...master)
|
||||
|
||||
@@ -48,8 +48,9 @@ dependencies = [
|
||||
"dnfile==0.14.1",
|
||||
"dncil==1.0.2",
|
||||
"pydantic==2.7.1",
|
||||
"rich==13.4.2",
|
||||
"humanize==4.9.0",
|
||||
"protobuf==5.27.0",
|
||||
"rich==13.4.2"
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
@@ -95,6 +96,7 @@ dev = [
|
||||
"types-psutil==5.8.23",
|
||||
"types_requests==2.32.0.20240523",
|
||||
"types-protobuf==5.26.0.20240422",
|
||||
"deptry==0.14"
|
||||
]
|
||||
build = [
|
||||
"pyinstaller==6.7.0",
|
||||
@@ -102,6 +104,77 @@ build = [
|
||||
"build==1.2.1"
|
||||
]
|
||||
|
||||
[tool.deptry]
|
||||
extend_exclude = [
|
||||
"sigs",
|
||||
"tests"
|
||||
]
|
||||
|
||||
# dependencies marked as first party, to inform deptry that they are local
|
||||
known_first_party = [
|
||||
"backports",
|
||||
"binaryninja",
|
||||
"flirt",
|
||||
"ghidra",
|
||||
"ida_bytes",
|
||||
"ida_entry",
|
||||
"ida_funcs",
|
||||
"ida_kernwin",
|
||||
"ida_loader",
|
||||
"ida_nalt",
|
||||
"ida_segment",
|
||||
"idaapi",
|
||||
"idautils",
|
||||
"idc",
|
||||
"java",
|
||||
"netnode",
|
||||
"PyQt5"
|
||||
]
|
||||
|
||||
[tool.deptry.per_rule_ignores]
|
||||
# dependencies defined but not used in the codebase
|
||||
DEP002 = [
|
||||
"black",
|
||||
"build",
|
||||
"deptry",
|
||||
"flake8",
|
||||
"flake8-bugbear",
|
||||
"flake8-comprehensions",
|
||||
"flake8-copyright",
|
||||
"flake8-encodings",
|
||||
"flake8-logging-format",
|
||||
"flake8-no-implicit-concat",
|
||||
"flake8-print",
|
||||
"flake8-simplify",
|
||||
"flake8-todos",
|
||||
"flake8-use-pathlib",
|
||||
"isort",
|
||||
"mypy",
|
||||
"mypy-protobuf",
|
||||
"pre-commit",
|
||||
"pyinstaller",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-instafail",
|
||||
"pytest-sugar",
|
||||
"ruff",
|
||||
"setuptools",
|
||||
"types-backports",
|
||||
"types-colorama",
|
||||
"types-protobuf",
|
||||
"types-psutil",
|
||||
"types-PyYAML",
|
||||
"types-tabulate",
|
||||
"types-termcolor",
|
||||
"types_requests",
|
||||
"wcwidth"
|
||||
]
|
||||
|
||||
# dependencies imported but missing from definitions
|
||||
DEP003 = [
|
||||
"typing_extensions" # TODO(s-ff): remove when Python 3.9 is deprecated, see #1699
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/mandiant/capa"
|
||||
Repository = "https://github.com/mandiant/capa.git"
|
||||
|
||||
Reference in New Issue
Block a user