-
Notifications
You must be signed in to change notification settings - Fork 80
/
pyproject.toml
179 lines (157 loc) · 5.11 KB
/
pyproject.toml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
[tool.poetry]
name = "unblob"
version = "24.11.13"
description = "Extract files from any kind of container formats"
authors = ["ONEKEY <[email protected]>"]
license = "MIT"
packages = [
{ include = "unblob" },
]
[tool.poetry.dependencies]
python = "^3.8"
click = "^8.1.7"
"dissect.cstruct" = ">=2.0,<5.0"
attrs = ">=23.1.0"
structlog = ">=24.1.0"
arpy = "^2.3.0"
rarfile = "^4.1"
ubi-reader = "^0.8.9"
plotext = ">=4.2.0,<6.0"
pluggy = "^1.3.0"
python-magic = "^0.4.27"
pyperscan = "^0.3.0"
lark = "^1.1.8"
lz4 = "^4.3.2"
lief = "^0.15.1"
cryptography = ">=41.0,<44.0"
treelib = "^1.7.0"
unblob-native = "^0.1.5"
jefferson = "^0.4.5"
rich = "^13.3.5"
pyfatfs = "^1.0.5"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pyright = "^1.1.349"
pre-commit = "^3.5.0"
pytest-cov = ">=3,<6"
ruff = "0.7.4"
pyyaml = "^6.0.1"
atheris = { version = "^2.3.0", python = "<3.12" }
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs-material = "9.5.44"
mkdocstrings = ">=0.24,<0.27"
pillow = ">=10.2.0,<11.0"
cairosvg = "^2.7.1"
mkdocstrings-python = "^1.8.0"
[tool.poetry.scripts]
unblob = "unblob.cli:main"
[tool.ruff]
target-version = "py38"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C90", # mccabe
"C4", # flake8-comprehensions
"COM818", # flake8-commas; trailing-comma-on-bare-tuple
"D", # pydocstyle
"E", # pycodestyle (errors)
"F", # pyflakes
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"N", # pep8-naming
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # ruff's own lints
"RSE", # flake8-raise
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle (warnings)
]
ignore = [
"B027", # empty-method-without-abstract-decorator: It is okay to have empty methods in abstract classes
"D1", # undocumented-*: We are not documenting every public symbol
"D203", # one-blank-line-before-class: D211 (no-blank-line-before-class) is used instead
"D213", # multi-line-summary-second-line: D212 (multi-line-summary-first-line) is used instead
"E501", # line-too-long: Let black handle line length violations
"N818", # error-suffix-on-exception-name: Exception names can be meaningful without smurfs
"PLC0414", # useless-import-alias: Enable explicitly re-exporting public symbols
"PLR09", # too-many-{arguments,branches,...}: We do not want to impose hard limits
"PTH201", # path-constructor-current-directory: Having "." explicitly passed expresses intent more clearly
"RUF012", # mutable-class-default: Wants to annotate things like `Handler.PATTERNS` with `ClassVar`, producing noise
"S101", # assert: Enable usage of asserts
"S603", # subprocess-without-shell-equals-true: This check just highlights, that we should check for untrusted inputs
"S607", # start-process-with-partial-path: In our case, the convenience of allowing partial paths outweighs the risks
"TRY003", # raise-vanilla-args: We are adding contextual information in exception messages
"TRY400", # error-instead-of-exception: It is okay to log without backtrace in except blocks
]
# Do not remove unused imports automatically in __init__.py files
ignore-init-module-imports = true
[tool.ruff.lint.per-file-ignores]
".github/*" = [
"T201" # print
]
"tests/*" = [
"FBT001", # boolean-positional-arg-in-function-definition: allowed in `pytest.param()`
"FBT003", # boolean-positional-value-in-function-call: allowed test parameters
]
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true # code like `dict(a=1, b=2)` is allowed
[tool.ruff.lint.mccabe]
max-complexity = 8
[tool.ruff.lint.pylint]
allow-magic-value-types = [
"bytes",
"int", # bunch of ad-hoc bitmask values
"str",
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "csv"
[tool.pytest.ini_options]
addopts = "--cov=unblob --cov=tests --cov-branch --cov-fail-under=90"
norecursedirs = """
*.egg
*_extract
.*
dist
build
target
tests/integration
"""
[tool.coverage.paths]
source = ["unblob", "tests"]
[tool.coverage.run]
branch = true
parallel = true
sigterm = true
concurrency = ["multiprocessing"]
source = ["unblob", "tests"]
[tool.coverage.report]
skip_covered = true
fail_under = 90
[tool.vulture]
paths = ["unblob/", "vulture_whitelist.py" ]
exclude = ["unblob/testing.py"]
[tool.pyright]
exclude = ["build"]
typeCheckingMode = "basic"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"