-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
233 lines (215 loc) · 6.38 KB
/
Copy pathpyproject.toml
File metadata and controls
233 lines (215 loc) · 6.38 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
# ============================================================================
# Build System
# ============================================================================
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
# ============================================================================
# Project Metadata (PEP 621)
# ============================================================================
[project]
name = "virtuals-py"
version = "0.1.8"
description = "Virtual Python collections over any storage."
readme = "README.md"
license = "Apache-2.0"
authors = [
{name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
]
maintainers = [
{name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
]
keywords = [
"nustack",
"python",
"key-value-store",
"collections",
"lazy-loading",
"rocksdb",
"storage",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"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",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Database",
]
requires-python = ">=3.10"
dependencies = [
"attrs",
"virtuals-binary-codec>=0.1.1",
"kh57",
"typing-extensions>=4.7.0",
]
[project.urls]
Homepage = "https://github.com/nustackdev/virtuals"
Documentation = "https://github.com/nustackdev/virtuals#readme"
Repository = "https://github.com/nustackdev/virtuals"
Issues = "https://github.com/nustackdev/virtuals/issues"
Changelog = "https://github.com/nustackdev/virtuals/releases"
[tool.uv.sources]
virtuals-binary-codec = { path = "lib/binary-codec", editable = true }
[project.optional-dependencies]
rocksdb = ["rdbpython"]
lmdb = ["lmdb"]
redis = [
"redis>=5.0",
"msgpack>=1.0",
]
# Every storage backend
all = [
"virtuals-py[rocksdb,lmdb,redis]",
]
# Development tools, including everything the test suite needs
dev = [
"ruff>=0.1.0",
"pre-commit>=3.0.0",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0",
"pytest-timeout>=2.1.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.0.0",
]
# ============================================================================
# Package Discovery
# ============================================================================
[tool.setuptools.packages.find]
where = ["src"]
include = ["virtuals*"]
namespaces = false
# =============================================================
# Coverage
# ============================================================================
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/site-packages/*",
]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
]
precision = 2
show_missing = true
[tool.coverage.html]
directory = "tests/reports/coverage"
# ============================================================================
# Linting & Formatting - Ruff
# ============================================================================
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src", "tests"]
extend-exclude = [
".venv",
"build",
"dist",
"*.egg-info",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
"YTT", # flake8-2020
"S", # flake8-bandit (security)
"T20", # flake8-print
"D", # pydocstyle
"ANN", # flake8-annotations
"TC", # flake8-type-checking
"RUF", # ruff-specific rules
"PTH", # flake8-pathlib
]
ignore = [
"E501", # Line too long (handled by formatter)
"D105", # Missing docstring in magic method
]
[tool.ruff.lint.pydocstyle]
convention = "google" # Use Google style format
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert allowed in tests
"T20", # print allowed in tests
"D", # docstrings not required in tests
"E711",
"E712",
"ANN", # type annotations not required in tests
"N806", # disable variable name checks
]
"src/**/testing/**/*.py" = [
"S101", # assert allowed in tests
"T20", # print allowed in tests
"D", # docstrings not required in tests
"E711",
"E712",
"ANN", # type annotations not required in tests
"N806", # disable variable name checks
"B017", # FIXME: blind exception pass; fix, remove this later
]
"examples/**/*.py" = [
"S101", # assert allowed in examples
"T20", # print allowed in examples
"D", # docstrings not required in examples
"ANN", # type annotations not required in examples
]
"setup.py" = [
"T20", # print allowed in setup
"D", # docstrings not required in setup
]
[tool.ruff.lint.isort]
known-first-party = ["virtuals"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true # Format code blocks in docstrings
docstring-code-line-length = 80 # Shorter lines in docstring examples
# ============================================================================
# Type Checking - mypy
# ============================================================================
[tool.mypy]
python_version = "3.10" # Match minimum supported version
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
exclude = [
"build/",
"dist/",
".venv/",
]
# ============================================================================
# Security
# ============================================================================
[tool.bandit]
exclude_dirs = ["tests/", "examples/", "docs/"]