Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
205 lines (185 loc) · 5.45 KB
/
Copy pathpyproject.toml
File metadata and controls
205 lines (185 loc) · 5.45 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "kicomav"
version = "0.41"
description = "KICOM Anti-Virus II - Open source antivirus engine for Python"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Kei Choi", email = "hanul93@gmail.com"}
]
keywords = ["antivirus", "malware", "security", "scanner", "virus"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Security",
"Topic :: System :: Systems Administration",
]
requires-python = ">=3.10"
dependencies = [
"rich>=13.0.0",
"requests>=2.28.0",
"python-dotenv>=1.0.0",
"yara-python>=4.3.0",
"py7zr>=0.20.0",
"rarfile>=4.0",
"pycabfile>=0.1.0",
]
[project.optional-dependencies]
full = [
"pylzma>=0.5.0",
]
daemon = [
"fastapi>=0.100.0",
"uvicorn[standard]>=0.23.0",
"python-multipart>=0.0.6",
]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"coverage>=7.0.0",
"ruff>=0.1.0",
"bandit[toml]>=1.7.0",
"safety>=2.3.0",
"mypy>=1.0.0",
"pre-commit>=3.0.0",
"httpx>=0.25.0",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
]
[project.scripts]
k2 = "kicomav.k2:main"
k2c = "kicomav.k2c:main"
k2d = "kicomav.k2d:main"
[project.urls]
Homepage = "https://github.com/hanul93/kicomav"
Repository = "https://github.com/hanul93/kicomav"
Documentation = "https://github.com/hanul93/kicomav#readme"
"Bug Tracker" = "https://github.com/hanul93/kicomav/issues"
[tool.setuptools]
include-package-data = true
package-dir = {"" = "."}
[tool.setuptools.packages.find]
where = ["."]
include = ["kicomav*"]
[tool.setuptools.package-data]
"kicomav.plugins" = ["*.py", "kicom.lst"]
"kicomav.kavcore" = ["*.py"]
"kicomav.daemon" = ["*.py"]
[tool.black]
line-length = 120
target-version = ["py310", "py311", "py312", "py313"]
[tool.pytest.ini_options]
testpaths = ["test"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# Suppress log output during tests (only show ERROR and above)
log_cli = true
log_cli_level = "ERROR"
log_level = "ERROR"
filterwarnings = [
"ignore::DeprecationWarning",
]
[tool.coverage.run]
source = ["kicomav"]
omit = [
"kicomav/k2.py",
"kicomav/k2c.py",
"kicomav/k2d.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"raise NotImplementedError",
]
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
]
ignore = [
"E501", # line too long (handled by formatter)
"E722", # bare except (legacy code)
"F841", # local variable assigned but never used
"E741", # ambiguous variable name
"E402", # module level import not at top of file
"F401", # imported but unused (some are for re-export)
"F405", # may be undefined from star imports (ctypes)
"F403", # star import used
"E731", # do not assign a lambda expression
"W293", # blank line contains whitespace
"W291", # trailing whitespace
]
[tool.ruff.lint.per-file-ignores]
"test/*" = ["B", "C4"] # Relax rules for tests
[tool.bandit]
exclude_dirs = ["test", ".venv", "venv"]
skips = [
"B101", # assert_used (OK in production code for this project)
"B104", # hardcoded_bind_all_interfaces (used in security blocklist)
"B110", # try_except_pass (intentional for worker cleanup)
"B302", # marshal (signature files, already secured in Phase 1)
"B310", # urllib_urlopen (already validated by validate_url)
"B311", # random (not used for security)
"B324", # hashlib MD5/SHA1 (used for file identification, not security)
"B404", # import_subprocess
"B406", # xml_sax (required for HWPX parsing)
"B603", # subprocess_without_shell_equals_true
"B607", # start_process_with_partial_path
]
[tool.mypy]
python_version = "3.10"
warn_return_any = false
warn_unused_ignores = false
ignore_missing_imports = true
exclude = [
"test/",
"build/",
"dist/",
]
# Gradual typing - start with basic checks
disallow_untyped_defs = false
check_untyped_defs = false
# Disable strict optional checking for gradual adoption
strict_optional = false
# Disable some checks for legacy code
disable_error_code = [
"no-redef", # Allow import redefinitions in try/except
"attr-defined", # Allow dynamic attributes
"var-annotated", # Don't require all variable annotations
"union-attr", # Don't check optional attributes strictly
"arg-type", # Relax argument type checking
"assignment", # Relax assignment checking
"operator", # Relax operator checking
"type-var", # Relax type variable checking
"import-untyped", # Allow imports without type stubs
]
# Per-module overrides for fully typed modules
[[tool.mypy.overrides]]
module = [
"kicomav.kavcore.k2security",
"kicomav.kavcore.k2file",
"kicomav.plugins.kernel",
]
check_untyped_defs = true
warn_return_any = false