-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
151 lines (130 loc) · 3.77 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
[tool.poetry]
name = "bomsquad-vulndb"
version = "0.1.0"
description = "Compilation of the National Vulnerability Database, and all public OSV data sources"
authors = ["Timothy M. Wyatt <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
packages = [
{ include = "bomsquad/vulndb", from = "src" }
]
[tool.poetry.scripts]
vulndb = "bomsquad.vulndb.cli.vulndb:app"
[tool.poetry.dependencies]
python = "^3.10"
pydantic = "^2.1"
psycopg2 = "^2.9.6"
retry = "^0.9.2"
tomli = "^2.0.1"
typer = "^0.9.0"
packageurl-python = "^0.11.2"
datamodel-code-generator = ">=0.21.0"
rich = "^13.4.2"
univers = "^30.10.0"
cpe = "^1.2.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.group.dev.dependencies]
black = "^23.1"
flake8 = "^6.0.0"
mypy = "^1.0.0"
poethepoet = "^0.18"
pre-commit = "^3.0"
pytest = "^7.1"
pytest-cov = "^4.0"
pyupgrade = "^3.1"
reorder-python-imports = "^3.9.0"
safety = "^2.3"
shellcheck-py = "^0.9.0.2"
typing-extensions = "^4.3"
datamodel-code-generator = {extras = ["http"], version = ">=0.21.0"}
types-retry = "^0.9.9.3"
types-requests = "^2.31.0.1"
polyfactory = "^2.11.0"
[tool.black]
line-length = 100
# https://coverage.readthedocs.io/en/latest/config.html#report
[tool.coverage.report]
fail_under = 50
show_missing = true
skip_covered = true
exclude_lines = [
"pragma: no cover",
"\\.\\.\\.",
"if __name__ == \"__main__\":",
"raise AssertionError",
]
# https://coverage.readthedocs.io/en/latest/config.html#run
[tool.coverage.run]
branch = true
command_line = "--module pytest src tests"
data_file = "test-reports/.coverage"
source = ["src"]
# https://coverage.readthedocs.io/en/latest/config.html#xml
[tool.coverage.xml]
output = "test-reports/coverage.xml"
# https://mypy.readthedocs.io/en/latest/config_file.html
[tool.mypy]
mypy_path = "src"
namespace_packages = true
explicit_package_bases = true
junit_xml = "test-reports/mypy.xml"
plugins = "pydantic.mypy"
strict = true
disallow_subclassing_any = false
disallow_untyped_decorators = false
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
warn_unreachable = true
allow_untyped_calls = true
# https://pydantic-docs.helpmanual.io/mypy_plugin/#configuring-the-plugin
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
# http://www.pydocstyle.org/en/latest/usage.html#configuration-files
[tool.pydocstyle]
convention = "numpy"
# https://docs.pytest.org/en/latest/customize.html#adding-default-options
[tool.pytest.ini_options]
log_cli = true
addopts = "-W error -W ignore::pytest.PytestUnraisableExceptionWarning -W ignore::DeprecationWarning --doctest-modules --exitfirst --failed-first --strict-config --strict-markers --verbosity=2 --junitxml=test-reports/pytest.xml"
junit_family = "xunit2"
testpaths = "tests"
[tool.tox]
legacy_tox_ini = """
[tox]
skipsdist = true
envlist = py38, py39
"""
[tool.poe.tasks]
[tool.poe.tasks.build_code]
help = "Build python code"
cmd = "poetry build"
[tool.poe.tasks.unit_test]
help = "Run unit test suite"
cmd = "poetry run pytest --cov=bomsquad.vulndb --cov-report html:test-reports/coverage/ --junit-xml=test-reports/pytest-report.xml tests/unit"
[tool.poe.tasks.data_validation_test]
help = "Run integration test suite"
cmd = "poetry run pytest tests/data_validation"
[tool.poe.tasks.test]
help = "Run all tests"
sequence = [
"unit_test",
"data_validation_test"
]
[tool.poe.tasks.lint]
help = "Lint this package"
[[tool.poe.tasks.lint.sequence]]
cmd = """
pre-commit run
--all-files
--color always
"""
[[tool.poe.tasks.lint.sequence]]
shell = "safety check --full-report || true"