forked from anchore/vunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
237 lines (219 loc) · 7.62 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
[project]
name = "vunnel"
requires-python = ">=3.9.0"
[tool.poetry.scripts]
vunnel = "vunnel.cli:run"
[tool.poetry]
name = "vunnel"
version = "0.0.0" # note: this is automagically managed -- no need to manually change this
description = "vunnel ~= 'vulnerability data funnel'"
authors = ["Alex Goodman <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/anchore/vunnel"
exclude = [
"tests/**/*"
]
keywords = [
"vulnerability",
"data",
"aggregator",
"grype",
"vulnerability-data",
]
classifiers = [
# derived from https://pypi.org/classifiers/
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
[tool.poetry.dependencies]
python = "^3.9"
click = "^8.1.3"
requests = "^2.28.1"
colorlog = "^6.7.0"
PyYAML = ">= 6.0, < 7.0" # note: required for enterprise
ijson = ">= 2.5.1, < 3.0" # note: required for enterprise
xxhash = "^3.1.0"
cvss = ">=2.6,<4.0"
python-dateutil = "^2.8.2"
defusedxml = "^0.7.1"
orjson = "^3.8.6"
SQLAlchemy = ">= 1.4.46, < 2.0" # note: 1.4.x currently required for enterprise
mergedeep = "^1.3.4"
importlib-metadata = "^7.0.1"
xsdata = {extras = ["cli", "lxml", "soap"], version = "=22.12"}
pytest-snapshot = "^0.9.0"
mashumaro = "^3.10"
iso8601 = "^2.1.0"
zstandard = ">=0.22,<0.24"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.2.2,<9.0.0"
pre-commit = "^3.2.0"
black = ">=23.1,<25.0"
jsonschema = "^4.17.3"
pytest-unordered = ">=0.5.2,<0.7.0"
pytest-sugar = ">=0.9.6,<1.1.0"
pytest-clarity = "^1.0.1"
pytest-cov = ">=4,<6"
pytest-picked = ">=0.4.6,<0.6.0"
pytest-mock = "^3.10.0"
pytest-xdist = "^3.2.1"
types-PyYAML = "^6.0.12.5"
types-requests = "^2.28.11.7"
mypy = "^1.1"
radon = ">=5.1,<7.0"
dunamai = "^1.15.0"
ruff = ">=0.5.1,<0.5.7"
yardstick = {git = "https://github.com/anchore/yardstick", rev = "v0.9.2"}
tabulate = "0.9.0"
tox = "^4.11.3"
[build-system]
requires = ["poetry-core>=1.3.0", "poetry-dynamic-versioning"]
# note: this is a thin wrapper around "poetry.core.masonry.api"
build-backend = "poetry_dynamic_versioning.backend"
[tool.pytest.ini_options]
cache_dir = ".cache/pytest"
[tool.mypy]
cache_dir = ".cache/mypy"
follow_imports = "silent"
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
disallow_untyped_defs = true
ignore_missing_imports = true
exclude = '''(?x)(
^src/vunnel/providers/alpine/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/amazon/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/debian/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/github/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/mariner/model/ # generated code
| ^src/vunnel/providers/nvd/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/oracle/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/rhel/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/rhel/oval_parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/sles/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/ubuntu/git\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/ubuntu/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/providers/wolfi/parser\.py$ # ported from enterprise, never had type hints
| ^src/vunnel/utils/oval_v2.py$ # ported from enterprise, never had type hints
| ^src/vunnel/utils/oval_parser.py$ # ported from enterprise, never had type hints
| ^src/vunnel/utils/fdb.py$ # ported from enterprise, never had type hints
| ^src/vunnel/utils/vulnerability.py$ # ported from enterprise, never had type hints
| ^tests/.*$ # any tests
)'''
[tool.black]
line-length = 130
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| data
| backup
| src/vunnel/providers/mariner/model # files in here are generated
| tests/quality/vulnerability-match-labels
| tests/quality/.yardstick
| tests/quality/data
| tests/quality/build
| tests/quality/bin
)/
)
'''
[tool.coverage.run]
omit = [
".*",
"*/site-packages/*",
"*/venv/*",
"tests/*",
"src/vunnel/__main__.py",
"src/vunnel/cli/__init__.py",
]
[tool.coverage.report]
fail_under = 75
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
metadata = false
style = "semver"
dirty = true
[tool.ruff]
cache-dir = ".cache/ruff"
# allow for a wide-birth relative to what black will correct to
line-length = 150
extend-exclude = [
"**/tests/**",
"src/vunnel/providers/mariner/model/**" # these are generated
]
[tool.ruff.lint]
ignore = [
"ARG001", # unused args are ok, as they communicate intent in interfaces, even if not used in impls.
"ARG002", # unused args are ok, as they communicate intent in interfaces, even if not used in impls.
"G004", # it's ok to use formatted strings for logging
"PGH004", # no blanked "noqa" usage, can be improved over time, but not now
"PLR2004", # a little too agressive, not allowing any magic numbers
"PLW2901", # "Outer for loop variable X overwritten by inner assignment target", not useful in most cases
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` -- not compatible with python 3.9 (even with __future__ import)
]
select = [
"A", # flake8-builtins
# "ANN", # flake8-annotations # this is great, but let mypy handle this so it can honor type:ignore comments without noqa comments too
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C", # mccabe
"C4", # flake8-comprehensions
"COM", # flake8-commas
"DTZ", # flake8-datetimez
"E", # pycodestyle, errors
# "EM", # flake8-errmsg # seems to aggressive relative to the current codebase
# "ERA", # flake8-eradicate # not all code in comments should be removed
"EXE", # flake8-executable
"F", # pyflakes
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint (this can be broken down into more checks if needed)
"PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib # the codebase is not ready for this yet, but would be nice to add
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flakes8-self
"T10", # flake8-debugger
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
# "TRY", # tryceratops # seems to aggressive relative to the current codebase
"UP", # pyupgrade
"W", # pycodestyle, warnings
"YTT", # flake8-2020
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"json.dump".msg = "Use orjson.dumps instead"
"json.dumps".msg = "Use orjson.dumps instead"
"json.load".msg = "Use orjson.loads instead"
"json.loads".msg = "Use orjson.loads instead"