-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
251 lines (218 loc) · 7.28 KB
/
pyproject.toml
File metadata and controls
251 lines (218 loc) · 7.28 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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
[project]
authors = [
{name = "sdn4z", email = "imsdn4z@gmail.com"},
]
requires-python = "<4,>=3.13"
dependencies = [
"httpx<1.0.0,>=0.28.0",
"python-dotenv<2.0.0,>=1.1.1",
"click<9.0.0,>=8.1.7",
"stamina<26.0.0,>=25.1.0",
"pydantic-settings[dotenv]<3.0.0,>=2.9.1",
"tiktoken<1.0.0,>=0.9.0",
"tomlkit<1.0.0,>=0.13.3",
"pydantic-ai-slim[google,openai]>=0.4.4",
"logfire>=3.25.0",
"sentry-sdk>=2.21.0,<3.0.0",
]
name = "lightman_ai"
version = "0.18.5"
description = "Cybersecurity news aggregator."
readme = "README.md"
[project.scripts]
lightman-ai = "lightman_ai.cli:entry_point"
[project.optional-dependencies]
test = [
"pytest<9.0.0,>=8.0.0",
"pytest-cov<6.0.0,>=5.0.0",
"pytest-asyncio<1.0.0,>=0.26.0",
]
lint = [
"mypy<2.0.0,>=1.1.1",
"ruff<1.0.0,>=0.11.0",
]
local = [
"ipdb<1.0.0,>=0.13.13",
"pdbpp<1.0.0,>=0.11.6",
"pre-commit<4.0.0,>=3.2.2",
"commitizen<5.0.0,>=4.8.3",
"codespell<3.0.0,>=2.2.4",
]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pytest.ini_options]
addopts = """
-s
--cov
--cov-report term-missing
--cov-report=xml:./tests/coverage.xml
--junitxml=./tests/junit.xml
"""
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
[tool.logfire]
ignore_no_config=true
[tool.ruff]
target-version = "py312"
line-length = 120
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C", # mccabe
"E", # pycodestyle
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # bugbear
"D", # pydocstyle
"I", # isort
"C4", # comprehensions
"SIM", # simplify
"N", # pep8-naming
"TRY", # tryceratops
"UP", # pyupgrade
"PT", # pytest-style
"TCH", # type-checking
"PL", # pylint
"G", # logging format
"TID", # tidy-imports
]
ignore = [
"E501", # line-length (enforced by black instead)
'D1', # pydocstyle enforces docstrings everywhere
'TRY003', # tryceratops rule not useful
"PLR0913", # pylint rule not useful
"B008", # checks for function calls in default function arguments.
'D206', # conflicts with formatter
'W191', # conflicts with formatter
'D203', # conflicts with formatter
'D211', # conflicts with formatter
'D212', # conflicts with formatter
'UP031', # allow strings formated with %s
'PLR2004' # magic value
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.isort]
known-third-party = ["lightman_ai", "tests"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ANN", # no enforcement of type annotations in tests
"S", # bandit is not useful in tests
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"dateutil.tz".msg = "Use `zoneinfo` instead."
"pytz".msg = "Use `zoneinfo` instead."
[tool.mypy]
python_version = "3.13"
mypy_path = "src"
strict = true
pretty = true
warn_unused_ignores = true
enable_error_code = ["explicit-override"]
[tool.coverage.run]
omit = ["tests/*", "eval/*"]
[tool.coverage.report]
fail_under = 95
exclude_lines = [
"if TYPE_CHECKING:",
"pragma: no cover",
"raise NotImplementedError",
]
[tool.commitizen]
version_files = ["pyproject.toml:^version"]
name = "cz_customize"
version = "0.18.5"
tag_format = "v$version"
[tool.commitizen.customize]
message_template = "{{prefix}}{% if scope %}({{scope}}){% endif %}: {{subject}}{% if body %}\n\n{{body}}{% endif %}{% if is_breaking_change %}\n\nBREAKING CHANGE: {{footer}}{% else %}\n\n{{footer}}{% endif %}"
bump_pattern = "^(BREAKING[\\-\\ ]CHANGE|feat|fix|refactor|perf|ci|docs|style|test|chore|revert|build)(\\(.+\\))?(!)?"
change_type_order = [
"BREAKING CHANGE",
"Feat",
"Fix",
"Refactor",
"Perf",
"CI",
"Docs",
"Technical",
"Tests",
]
bump_message = "bump: version $current_version → $new_version"
schema = "<type>(<scope>): <subject>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n(BREAKING CHANGE: )<footer>"
schema_pattern = "(?s)(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"
commit_parser = "^(?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE|ci|docs|style|test|chore|revert|build)(?:\\((?P<scope>[^()\\r\\n]*)\\)|\\()?(?P<breaking>!)?:\\s(?P<message>.*)?"
version_parser = "(?P<version>([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?(\\w+)?)"
changelog_pattern = "^(BREAKING[\\-\\ ]CHANGE|feat|fix|refactor|perf|ci|docs|style|test|chore|revert|build)(\\(.+\\))?(!)?" # same as bump_pattern
[tool.commitizen.customize.bump_map]
"^.+!$" = "MAJOR"
"^BREAKING[\\-\\ ]CHANGE" = "MAJOR"
"^feat" = "MINOR"
"^fix" = "PATCH"
"^refactor" = "PATCH"
"^perf" = "PATCH"
"^ci" = "PATCH"
"^docs" = "PATCH"
"^style" = "PATCH"
"^test" = "PATCH"
"^chore" = "PATCH"
"^revert" = "PATCH"
"^build" = "PATCH"
[tool.commitizen.customize.change_type_map]
"feat" = "Feat"
"fix" = "Fix"
"refactor" = "Refactor"
"perf" = "Perf"
"ci" = "CI"
"docs" = "Docs"
"style" = "Technical"
"test" = "Tests"
"chore" = "Technical"
"revert" = "Fix"
"build" = "Technical"
[[tool.commitizen.customize.questions]]
type = "list"
name = "prefix"
message = "Select the type of change you are committing"
choices = [
{ value = "fix", name = "fix: A bug fix. Correlates with PATCH in SemVer", key = "x" },
{ value = "feat", name = "feat: A new feature. Correlates with MINOR in SemVer", key = "f" },
{ value = "docs", name = "docs: Documentation only changes", key = "d" },
{ value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", key = "s" },
{ value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature", key = "r" },
{ value = "perf", name = "perf: A code change that improves performance", key = "p" },
{ value = "test", name = "test: Adding missing or correcting existing tests", key = "t" },
{ value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)", key = "b" },
{ value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)", key = "c" },
]
[[tool.commitizen.customize.questions]]
type = "input"
name = "scope"
message = "What is the scope of this change? ((story number, class or file name): (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "subject"
message = "Write a short and imperative summary of the code changes: (lower case and no period)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "body"
message = "Provide additional contextual information about the code changes: (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "confirm"
message = "Is this a BREAKING CHANGE? Correlates with MAJOR in SemVer"
name = "is_breaking_change"
default = false
[[tool.commitizen.customize.questions]]
type = "input"
name = "footer"
message = "Footer. Information about Breaking Changes and reference issues that this commit closes: (press [enter] to skip)\n"
# TODO: Find a way to include pyproject.toml without the version changes
[tool.cruft]
skip = ["pyproject.toml"]
[[IgnoredVulns]]
# False positive for mkdocs, more info: https://github.com/mkdocs/mkdocs/issues/2601
id = "PYSEC-2021-878"