-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathpyproject.toml
More file actions
161 lines (142 loc) · 4.55 KB
/
pyproject.toml
File metadata and controls
161 lines (142 loc) · 4.55 KB
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
[project]
name = "grype-db-manager"
description = "a tool for publishing validated grype databases to S3 for distribution"
dynamic = ["version"]
authors = [
{name = "Alex Goodman", email = "wagoodman@users.noreply.github.com"},
]
license = {text = "Apache 2.0"}
requires-python = "<3.14,>=3.11"
dependencies = [
"boto3<2,>=1.28.16",
"click<9,>=8.1.6",
"dataclass-wizard<1,>=0.22.2",
"iso8601<3,>=2.0.0",
"requests<3,>=2.32.3",
"semver<4,>=3.0.1",
"tabulate<1,>=0.9.0",
"zstandard<1,>=0.21.0",
"colorlog<7,>=6.7.0",
"mergedeep<2,>=1.3.4",
"pyyaml<7,>=5.0.1",
"python-magic<1,>=0.4.27",
"yardstick<1,>=0.12.0",
"pyyaml-include>=2,<3",
]
[project.urls]
repository = "https://github.com/anchore/grype-db"
[project.scripts]
grype-db-manager = "grype_db_manager.cli:run"
[dependency-groups]
dev = [
"mypy<2,>=1.4.1",
"pytest>=7.4.0,<10",
"pytest-sugar>=0.9.7",
"pytest-unordered>=0.5.2",
"pytest-cov>=4.1.0",
"pytest-picked>=0.5.0",
"pytest-mock>=3.11.1",
"pytest-xdist>=3.3.1",
"ruff<1,>=0.0.282",
"types-requests<3,>=2.31.0.2",
"moto<5,>=4.1.14",
"coverage[toml]<8.0.0,>=7.6.10",
"uv-dynamic-versioning>=0.6.0",
]
# this section enables searching for package data...
[tool.setuptools.packages.find]
namespaces = true
where = ["manager/src"]
# .. once we can search, this section selects which
# static data to include in the package
[tool.setuptools.package-data]
"grype_db_manager.data" = ["*.json"] # the grype-schema-version-mapping.json file
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "uv-dynamic-versioning"]
[tool.hatch.build.targets.sdist]
include = [
"manager/src/grype_db_manager/**"
]
exclude = [
"manager/tests/**"
]
[tool.hatch.build.targets.wheel]
packages = ["manager/src/grype_db_manager"]
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
vcs = "git"
style = "semver"
fallback-version = "0.0.0"
[tool.pytest.ini_options]
testpaths = ["manager/tests"]
cache_dir = ".cache/pytest"
pythonpath = ["manager/src"]
norecursedirs = ["data"]
log_format = "%(levelname)-6s %(message)s"
log_cli_level = "INFO"
[tool.ruff]
cache-dir = ".cache/ruff"
# allow for a wide-birth relative to what black will correct to
line-length = 150
extend-exclude = [
"**/tests/**",
]
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C", # mccabe
"C4", # flake8-comprehensions
"COM", # flake8-commas
"DTZ", # flake8-datetimez
"E", # pycodestyle, errors
"EM", # flake8-errmsg
# "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
"UP", # pyupgrade
"W", # pycodestyle, warnings
"YTT", # flake8-2020
]
ignore = [
"ANN401", # should allow for typing.Any in *args and **kwargs
"ANN002", # don't require type annotations for arbirary *args
"ANN003", # don't require type annotations for arbirary **kwargs
"ANN204", # annotating return type of __init__ and __post_init__ is useless
"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
"RUF100", # no blanket "noqa" usage, can be improved over time, but not now
"TRY003", # specifying long messages outside the exception class is excellent context! why is this an antipattern?
"COM812", # conflicts with ruff formatter
]
[tool.ruff.lint.pylint]
max-args = 8