-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
334 lines (295 loc) · 9.35 KB
/
Copy pathpyproject.toml
File metadata and controls
334 lines (295 loc) · 9.35 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# ============================================================================
# Build System
# ============================================================================
[build-system]
requires = ["setuptools>=68.0", "wheel", "Cython>=3.0"]
build-backend = "setuptools.build_meta"
# ============================================================================
# Project Metadata (PEP 621)
# ============================================================================
[project]
name = "rdbpython"
version = "0.2.6"
description = "Python bindings for RocksDB with Cython"
readme = "README.md"
license = "Apache-2.0"
authors = [
{name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
]
maintainers = [
{name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
]
keywords = [
"rocksdb",
"database",
"key-value",
"storage",
"embedded",
"cython"
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"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",
"Programming Language :: Cython",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Database",
]
requires-python = ">=3.9"
dependencies = []
[project.urls]
Homepage = "https://github.com/nustackdev/rdbpy"
Documentation = "https://github.com/nustackdev/rdbpy#readme"
Repository = "https://github.com/nustackdev/rdbpy"
Issues = "https://github.com/nustackdev/rdbpy/issues"
PyPI = "https://pypi.org/project/rdbpython/"
[project.optional-dependencies]
# Development tools
dev = [
"ruff>=0.1.0",
"pre-commit>=3.0.0",
]
# Testing
test = [
"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",
]
# Cython build dependencies (for building from source)
cython = [
"Cython>=3.0.0",
"setuptools>=68.0",
]
# All development dependencies
all = [
"rdbpy[dev,test,cython]",
]
# ============================================================================
# Package Discovery
# ============================================================================
[tool.setuptools]
zip-safe = false
[tool.setuptools.packages.find]
where = ["src"]
include = ["rdbpy*"]
namespaces = false
[tool.setuptools.package-data]
rdbpy = [
"**/*.pyx",
"**/*.pxd",
"**/*.hpp",
"py.typed",
]
[tool.setuptools.exclude-package-data]
"*" = ["*.c", "*.cpp"]
# ============================================================================
# CI/CD - cibuildwheel configuration
# ============================================================================
[tool.cibuildwheel]
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
skip = [
"*-musllinux_*",
"*-win32",
"*-manylinux_i686",
]
build-verbosity = 1
test-command = "python -c \"import rdbpy; print('rdbpy imported successfully')\""
test-requires = ["pytest"]
# ============================================================================
# Linux-specific cibuildwheel settings
# ============================================================================
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"
before-all = [
"yum install -y wget gcc gcc-c++ make",
"bash {project}/scripts/build-rocksdb-linux.sh"
]
environment = { RDBPY_DEP_DIR="/tmp/rdbpy_deps", LD_LIBRARY_PATH="/tmp/rdbpy_deps/lib", LIBRARY_PATH="/tmp/rdbpy_deps/lib", PKG_CONFIG_PATH="/tmp/rdbpy_deps/lib/pkgconfig" }
repair-wheel-command = "LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs"
test-command = [
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
"python -c \"import rdbpy; db = rdbpy.DB('/tmp/test.db', rdbpy.Options(create_if_missing=True)); db.put(b'key', b'value'); assert db.get(b'key') == b'value'; print('RocksDB basic test passed')\""
]
# ============================================================================
# macOS-specific cibuildwheel settings
# ============================================================================
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
environment = { MACOSX_DEPLOYMENT_TARGET="10.14", RDBPY_DEP_DIR="/tmp/rdbpy_deps", DYLD_LIBRARY_PATH="/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH" }
before-all = [
"bash {project}/scripts/build-rocksdb-macos.sh"
]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
test-command = [
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
"python -c \"import rdbpy; db = rdbpy.DB('/tmp/test_macos.db', rdbpy.Options(create_if_missing=True)); db.put(b'key', b'value'); assert db.get(b'key') == b'value'; print('RocksDB basic test passed')\""
]
# ============================================================================
# Windows-specific cibuildwheel settings
# ============================================================================
[tool.cibuildwheel.windows]
before-all = [
"powershell -File {project}/scripts/build-rocksdb-windows.ps1"
]
environment = { RDBPY_DEP_DIR="C:\\rdbpy_deps" }
test-command = [
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
]
# ============================================================================
# Testing - pytest
# ============================================================================
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"--tb=short",
"--durations=10",
]
markers = [
"unit: Unit tests - fast, isolated",
"functional: Functional end-to-end tests",
"integration: Integration tests - cross-component",
"performance: Performance benchmarks",
"rocksdb: RocksDB tests",
"slow: Slow-running tests",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
# ============================================================================
# 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 = "py39"
src = ["src", "tests"]
extend-exclude = [
".venv",
"build",
"dist",
"*.egg-info",
"*.c",
"*.cpp",
"*.so",
]
[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"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert allowed in tests
"T20", # print allowed in tests
"D", # docstrings not required in tests
"ANN", # type annotations not required in tests
]
"bench/**/*.py" = [
"T20", # print allowed in benchmarks
"D", # docstrings not required in benchmarks
"ANN", # type annotations not required in benchmarks
]
"setup.py" = [
"T20", # print allowed in setup
"D", # docstrings not required in setup
]
"src/rdbpy/**/*.py" = [
"D", # Some docstrings may be in .pyx files
]
[tool.ruff.lint.isort]
known-first-party = ["rdbpy"]
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
docstring-code-line-length = 80
# ============================================================================
# Type Checking - mypy
# ============================================================================
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
exclude = [
"build/",
"dist/",
".venv/",
".*\\.pyx$",
]
[[tool.mypy.overrides]]
module = "rdbpy.*"
ignore_errors = true