rdbpython 0.0.1__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. rdbpython-0.2.1/LICENSE.md +21 -0
  2. rdbpython-0.2.1/MANIFEST.in +86 -0
  3. rdbpython-0.2.1/PKG-INFO +104 -0
  4. rdbpython-0.2.1/README.md +57 -0
  5. rdbpython-0.2.1/pyproject.toml +330 -0
  6. rdbpython-0.2.1/scripts/build-rocksdb-linux.sh +238 -0
  7. rdbpython-0.2.1/scripts/build-rocksdb-macos.sh +218 -0
  8. rdbpython-0.2.1/scripts/rocksdb-cstdint.patch +10 -0
  9. rdbpython-0.2.1/setup.py +359 -0
  10. rdbpython-0.2.1/src/rdbpy/__init__.py +1 -0
  11. rdbpython-0.2.1/src/rdbpy/backup.pxd +35 -0
  12. rdbpython-0.2.1/src/rdbpy/cache.pxd +8 -0
  13. rdbpython-0.2.1/src/rdbpy/comparator.pxd +23 -0
  14. rdbpython-0.2.1/src/rdbpy/db.pxd +230 -0
  15. rdbpython-0.2.1/src/rdbpy/env.pxd +5 -0
  16. rdbpython-0.2.1/src/rdbpy/errors.py +26 -0
  17. rdbpython-0.2.1/src/rdbpy/filter_policy.pxd +39 -0
  18. rdbpython-0.2.1/src/rdbpy/include/rdb_include/comparator_wrapper.hpp +63 -0
  19. rdbpython-0.2.1/src/rdbpy/include/rdb_include/filter_policy_wrapper.hpp +89 -0
  20. rdbpython-0.2.1/src/rdbpy/include/rdb_include/memtable_factories.hpp +15 -0
  21. rdbpython-0.2.1/src/rdbpy/include/rdb_include/merge_operator_wrapper.hpp +132 -0
  22. rdbpython-0.2.1/src/rdbpy/include/rdb_include/slice_transform_wrapper.hpp +109 -0
  23. rdbpython-0.2.1/src/rdbpy/include/rdb_include/utils.hpp +8 -0
  24. rdbpython-0.2.1/src/rdbpy/include/rdb_include/write_batch_iter_helper.hpp +65 -0
  25. rdbpython-0.2.1/src/rdbpy/interfaces.py +77 -0
  26. rdbpython-0.2.1/src/rdbpy/iterator.pxd +16 -0
  27. rdbpython-0.2.1/src/rdbpy/lib_rocksdb.pxd +768 -0
  28. rdbpython-0.2.1/src/rdbpy/lib_rocksdb.pyi +1465 -0
  29. rdbpython-0.2.1/src/rdbpy/lib_rocksdb.pyx +3221 -0
  30. rdbpython-0.2.1/src/rdbpy/lib_utils.py +52 -0
  31. rdbpython-0.2.1/src/rdbpy/logger.pxd +5 -0
  32. rdbpython-0.2.1/src/rdbpy/memtablerep.pxd +12 -0
  33. rdbpython-0.2.1/src/rdbpy/merge_operator.pxd +46 -0
  34. rdbpython-0.2.1/src/rdbpy/merge_operators.py +25 -0
  35. rdbpython-0.2.1/src/rdbpy/options.pxd +179 -0
  36. rdbpython-0.2.1/src/rdbpy/slice_.pxd +20 -0
  37. rdbpython-0.2.1/src/rdbpy/slice_transform.pxd +37 -0
  38. rdbpython-0.2.1/src/rdbpy/snapshot.pxd +3 -0
  39. rdbpython-0.2.1/src/rdbpy/status.pxd +15 -0
  40. rdbpython-0.2.1/src/rdbpy/std_memory.pxd +7 -0
  41. rdbpython-0.2.1/src/rdbpy/table_factory.pxd +50 -0
  42. rdbpython-0.2.1/src/rdbpy/transaction.pxd +154 -0
  43. rdbpython-0.2.1/src/rdbpy/universal_compaction.pxd +15 -0
  44. rdbpython-0.2.1/src/rdbpython.egg-info/PKG-INFO +104 -0
  45. rdbpython-0.2.1/src/rdbpython.egg-info/SOURCES.txt +55 -0
  46. rdbpython-0.2.1/src/rdbpython.egg-info/requires.txt +20 -0
  47. rdbpython-0.2.1/src/rdbpython.egg-info/top_level.txt +1 -0
  48. rdbpython-0.2.1/tests/conftest.py +11 -0
  49. rdbpython-0.2.1/tests/performance/rocksdb/__init__.py +0 -0
  50. rdbpython-0.2.1/tests/unit/rocksdb/__init__.py +0 -0
  51. rdbpython-0.2.1/tests/unit/rocksdb/test_db.py +670 -0
  52. rdbpython-0.2.1/tests/unit/rocksdb/test_memtable.py +30 -0
  53. rdbpython-0.2.1/tests/unit/rocksdb/test_options.py +171 -0
  54. rdbpython-0.2.1/tests/unit/rocksdb/test_transaction.py +116 -0
  55. rdbpython-0.0.1/PKG-INFO +0 -22
  56. rdbpython-0.0.1/rdbpython.egg-info/PKG-INFO +0 -22
  57. rdbpython-0.0.1/rdbpython.egg-info/SOURCES.txt +0 -5
  58. rdbpython-0.0.1/setup.py +0 -19
  59. {rdbpython-0.0.1 → rdbpython-0.2.1}/setup.cfg +0 -0
  60. {rdbpython-0.0.1 → rdbpython-0.2.1/src}/rdbpython.egg-info/dependency_links.txt +0 -0
  61. /rdbpython-0.0.1/rdbpython.egg-info/top_level.txt → /rdbpython-0.2.1/src/rdbpython.egg-info/not-zip-safe +0 -0
@@ -0,0 +1,21 @@
1
+ # The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Gor Arakelyan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,86 @@
1
+ # ============================================================================
2
+ # MANIFEST.in - Source Distribution File Inclusion
3
+ # ============================================================================
4
+
5
+ # ============================================================================
6
+ # Documentation and Metadata
7
+ # ============================================================================
8
+ include README.md
9
+ include LICENSE.md
10
+ include pyproject.toml
11
+ include setup.py
12
+
13
+ # py.typed marker for PEP 561 compliance
14
+ recursive-include src py.typed
15
+
16
+ # ============================================================================
17
+ # Build Scripts (for users building from source)
18
+ # ============================================================================
19
+ include scripts/build-rocksdb-linux.sh
20
+ include scripts/build-rocksdb-macos.sh
21
+ include scripts/rocksdb-cstdint.patch
22
+
23
+ # ============================================================================
24
+ # rdbpy Package Files
25
+ # ============================================================================
26
+ # Cython source files (.pyx, .pxd)
27
+ recursive-include src/rdbpy *.pyx
28
+ recursive-include src/rdbpy *.pxd
29
+
30
+ # C++ wrapper headers
31
+ recursive-include src/rdbpy/include *.hpp
32
+ recursive-include src/rdbpy/include *.h
33
+
34
+ # Python type stubs
35
+ recursive-include src/rdbpy *.pyi
36
+
37
+ # Python files
38
+ recursive-include src/rdbpy *.py
39
+
40
+ # ============================================================================
41
+ # Tests
42
+ # ============================================================================
43
+ recursive-include tests *.py
44
+
45
+ # ============================================================================
46
+ # Exclusions
47
+ # ============================================================================
48
+ # Exclude compiled files
49
+ global-exclude *.pyc
50
+ global-exclude *.pyo
51
+ global-exclude *.pyd
52
+ global-exclude __pycache__
53
+
54
+ # Exclude Cython-generated C/C++ files
55
+ global-exclude *.c
56
+ global-exclude *.cpp
57
+
58
+ # Exclude build artifacts
59
+ global-exclude *.so
60
+ global-exclude *.dylib
61
+ global-exclude *.dll
62
+ prune build
63
+ prune dist
64
+ prune *.egg-info
65
+
66
+ # Exclude IDE and editor files
67
+ global-exclude .DS_Store
68
+ global-exclude *.swp
69
+ global-exclude *.swo
70
+ global-exclude *~
71
+ prune .vscode
72
+ prune .idea
73
+
74
+ # Exclude version control
75
+ prune .git
76
+ global-exclude .gitignore
77
+ global-exclude .gitattributes
78
+
79
+ # Exclude CI/CD that users don't need
80
+ prune .github
81
+ exclude .pre-commit-config.yaml
82
+
83
+ # Exclude development files
84
+ exclude .coveragerc
85
+ exclude .ruff_cache
86
+ prune htmlcov
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: rdbpython
3
+ Version: 0.2.1
4
+ Summary: Python bindings for RocksDB with Cython
5
+ Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
+ Maintainer-email: Gor Arakelyan <gorarkln@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/everyabc/rdbpy
9
+ Project-URL: Documentation, https://github.com/everyabc/rdbpy#readme
10
+ Project-URL: Repository, https://github.com/everyabc/rdbpy
11
+ Project-URL: Issues, https://github.com/everyabc/rdbpy/issues
12
+ Project-URL: PyPI, https://pypi.org/project/rdbpython/
13
+ Keywords: rocksdb,database,key-value,storage,embedded,cython
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Programming Language :: Cython
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Topic :: Database
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE.md
30
+ Requires-Dist: attrs
31
+ Provides-Extra: dev
32
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
33
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest>=7.0.0; extra == "test"
36
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
37
+ Requires-Dist: pytest-xdist>=3.0.0; extra == "test"
38
+ Requires-Dist: pytest-timeout>=2.1.0; extra == "test"
39
+ Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
40
+ Requires-Dist: hypothesis>=6.0.0; extra == "test"
41
+ Provides-Extra: cython
42
+ Requires-Dist: Cython>=3.0.0; extra == "cython"
43
+ Requires-Dist: setuptools>=68.0; extra == "cython"
44
+ Provides-Extra: all
45
+ Requires-Dist: rdbpy[cython,dev,test]; extra == "all"
46
+ Dynamic: license-file
47
+
48
+ # rdbpy
49
+
50
+ [![Build Wheels](https://github.com/everyabc/rdbpy/actions/workflows/build.yml/badge.svg)](https://github.com/everyabc/rdbpy/actions/workflows/build.yml)
51
+ [![Tests](https://github.com/everyabc/rdbpy/actions/workflows/test.yml/badge.svg)](https://github.com/everyabc/rdbpy/actions/workflows/test.yml)
52
+ [![PyPI version](https://badge.fury.io/py/rdbpython.svg)](https://pypi.org/project/rdbpython/)
53
+ [![Python Versions](https://img.shields.io/pypi/pyversions/rdbpython.svg)](https://pypi.org/project/rdbpython/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
+
56
+ Python bindings for RocksDB with Cython - **batteries included!**
57
+
58
+ **No RocksDB installation required** - everything is bundled in the wheel for Linux and macOS (Intel + Apple Silicon).
59
+
60
+ ## Installation
61
+
62
+ ```bash
63
+ pip install rdbpython
64
+ ```
65
+
66
+ That's it! No need to install RocksDB or any compression libraries manually.
67
+
68
+ ## Usage
69
+
70
+ ```python
71
+ import rdbpy
72
+
73
+ # Open database
74
+ options = rdbpy.Options(create_if_missing=True)
75
+ db = rdbpy.DB('/path/to/db', options)
76
+
77
+ # Put/Get
78
+ db.put(b'key', b'value')
79
+ value = db.get(b'key')
80
+
81
+ # Iterate
82
+ it = db.iterkeys()
83
+ it.seek_to_first()
84
+ while it.valid():
85
+ print(it.key())
86
+ it.next()
87
+ ```
88
+
89
+ ## Development
90
+
91
+ ```bash
92
+ # Setup
93
+ make install
94
+
95
+ # Build
96
+ make build
97
+
98
+ # Test
99
+ make test
100
+ ```
101
+
102
+ ## License
103
+
104
+ MIT
@@ -0,0 +1,57 @@
1
+ # rdbpy
2
+
3
+ [![Build Wheels](https://github.com/everyabc/rdbpy/actions/workflows/build.yml/badge.svg)](https://github.com/everyabc/rdbpy/actions/workflows/build.yml)
4
+ [![Tests](https://github.com/everyabc/rdbpy/actions/workflows/test.yml/badge.svg)](https://github.com/everyabc/rdbpy/actions/workflows/test.yml)
5
+ [![PyPI version](https://badge.fury.io/py/rdbpython.svg)](https://pypi.org/project/rdbpython/)
6
+ [![Python Versions](https://img.shields.io/pypi/pyversions/rdbpython.svg)](https://pypi.org/project/rdbpython/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ Python bindings for RocksDB with Cython - **batteries included!**
10
+
11
+ **No RocksDB installation required** - everything is bundled in the wheel for Linux and macOS (Intel + Apple Silicon).
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install rdbpython
17
+ ```
18
+
19
+ That's it! No need to install RocksDB or any compression libraries manually.
20
+
21
+ ## Usage
22
+
23
+ ```python
24
+ import rdbpy
25
+
26
+ # Open database
27
+ options = rdbpy.Options(create_if_missing=True)
28
+ db = rdbpy.DB('/path/to/db', options)
29
+
30
+ # Put/Get
31
+ db.put(b'key', b'value')
32
+ value = db.get(b'key')
33
+
34
+ # Iterate
35
+ it = db.iterkeys()
36
+ it.seek_to_first()
37
+ while it.valid():
38
+ print(it.key())
39
+ it.next()
40
+ ```
41
+
42
+ ## Development
43
+
44
+ ```bash
45
+ # Setup
46
+ make install
47
+
48
+ # Build
49
+ make build
50
+
51
+ # Test
52
+ make test
53
+ ```
54
+
55
+ ## License
56
+
57
+ MIT
@@ -0,0 +1,330 @@
1
+ # ============================================================================
2
+ # Build System
3
+ # ============================================================================
4
+ [build-system]
5
+ requires = ["setuptools>=68.0", "wheel", "Cython>=3.0"]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ # ============================================================================
9
+ # Project Metadata (PEP 621)
10
+ # ============================================================================
11
+ [project]
12
+ name = "rdbpython"
13
+ version = "0.2.1"
14
+ description = "Python bindings for RocksDB with Cython"
15
+ readme = "README.md"
16
+ license = "MIT"
17
+ authors = [
18
+ {name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
19
+ ]
20
+ maintainers = [
21
+ {name = "Gor Arakelyan", email = "gorarkln@gmail.com"}
22
+ ]
23
+ keywords = [
24
+ "rocksdb",
25
+ "database",
26
+ "key-value",
27
+ "storage",
28
+ "embedded",
29
+ "cython"
30
+ ]
31
+ classifiers = [
32
+ "Development Status :: 3 - Alpha",
33
+ "Intended Audience :: Developers",
34
+ "Operating System :: OS Independent",
35
+ "Programming Language :: Python :: 3",
36
+ "Programming Language :: Python :: 3.9",
37
+ "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.11",
39
+ "Programming Language :: Python :: 3.12",
40
+ "Programming Language :: Python :: 3.13",
41
+ "Programming Language :: Python :: Implementation :: CPython",
42
+ "Programming Language :: Cython",
43
+ "Topic :: Software Development :: Libraries :: Python Modules",
44
+ "Topic :: Database",
45
+ ]
46
+ requires-python = ">=3.9"
47
+ dependencies = [
48
+ "attrs",
49
+ ]
50
+
51
+ [project.urls]
52
+ Homepage = "https://github.com/everyabc/rdbpy"
53
+ Documentation = "https://github.com/everyabc/rdbpy#readme"
54
+ Repository = "https://github.com/everyabc/rdbpy"
55
+ Issues = "https://github.com/everyabc/rdbpy/issues"
56
+ PyPI = "https://pypi.org/project/rdbpython/"
57
+
58
+ [project.optional-dependencies]
59
+ # Development tools
60
+ dev = [
61
+ "ruff>=0.1.0",
62
+ "pre-commit>=3.0.0",
63
+ ]
64
+
65
+ # Testing
66
+ test = [
67
+ "pytest>=7.0.0",
68
+ "pytest-cov>=4.0.0",
69
+ "pytest-xdist>=3.0.0",
70
+ "pytest-timeout>=2.1.0",
71
+ "pytest-benchmark>=4.0.0",
72
+ "hypothesis>=6.0.0",
73
+ ]
74
+
75
+ # Cython build dependencies (for building from source)
76
+ cython = [
77
+ "Cython>=3.0.0",
78
+ "setuptools>=68.0",
79
+ ]
80
+
81
+ # All development dependencies
82
+ all = [
83
+ "rdbpy[dev,test,cython]",
84
+ ]
85
+
86
+ # ============================================================================
87
+ # Package Discovery
88
+ # ============================================================================
89
+ [tool.setuptools]
90
+ zip-safe = false
91
+
92
+ [tool.setuptools.packages.find]
93
+ where = ["src"]
94
+ include = ["rdbpy*"]
95
+ namespaces = false
96
+
97
+ [tool.setuptools.package-data]
98
+ rdbpy = [
99
+ "**/*.pyx",
100
+ "**/*.pxd",
101
+ "**/*.hpp",
102
+ "py.typed",
103
+ ]
104
+
105
+ [tool.setuptools.exclude-package-data]
106
+ "*" = ["*.c", "*.cpp"]
107
+
108
+ # ============================================================================
109
+ # CI/CD - cibuildwheel configuration
110
+ # ============================================================================
111
+ [tool.cibuildwheel]
112
+ build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
113
+
114
+ skip = [
115
+ "*-musllinux_*",
116
+ "*-win32",
117
+ "*-manylinux_i686",
118
+ ]
119
+
120
+ build-verbosity = 1
121
+
122
+ test-command = "python -c \"import rdbpy; print('rdbpy imported successfully')\""
123
+ test-requires = ["pytest"]
124
+
125
+ # ============================================================================
126
+ # Linux-specific cibuildwheel settings
127
+ # ============================================================================
128
+ [tool.cibuildwheel.linux]
129
+ manylinux-x86_64-image = "manylinux2014"
130
+ manylinux-aarch64-image = "manylinux2014"
131
+
132
+ before-all = [
133
+ "yum install -y wget gcc gcc-c++ make",
134
+ "bash {project}/scripts/build-rocksdb-linux.sh"
135
+ ]
136
+
137
+ 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" }
138
+
139
+ repair-wheel-command = "LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs"
140
+
141
+ test-command = [
142
+ "python -c \"import rdbpy; print('rdbpy imported successfully')\"",
143
+ "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')\""
144
+ ]
145
+
146
+ # ============================================================================
147
+ # macOS-specific cibuildwheel settings
148
+ # ============================================================================
149
+ [tool.cibuildwheel.macos]
150
+ archs = ["x86_64", "arm64"]
151
+
152
+ environment = { MACOSX_DEPLOYMENT_TARGET="10.14", RDBPY_DEP_DIR="/tmp/rdbpy_deps", DYLD_LIBRARY_PATH="/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH" }
153
+
154
+ before-all = [
155
+ "bash {project}/scripts/build-rocksdb-macos.sh"
156
+ ]
157
+
158
+ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
159
+
160
+ test-command = [
161
+ "python -c \"import rdbpy; print('rdbpy imported successfully')\"",
162
+ "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')\""
163
+ ]
164
+
165
+ # ============================================================================
166
+ # Windows-specific cibuildwheel settings
167
+ # ============================================================================
168
+ [tool.cibuildwheel.windows]
169
+ before-all = [
170
+ "powershell -File {project}/scripts/build-rocksdb-windows.ps1"
171
+ ]
172
+
173
+ environment = { RDBPY_DEP_DIR="C:\\rdbpy_deps" }
174
+
175
+ test-command = [
176
+ "python -c \"import rdbpy; print('rdbpy imported successfully')\"",
177
+ ]
178
+
179
+ # ============================================================================
180
+ # Testing - pytest
181
+ # ============================================================================
182
+ [tool.pytest.ini_options]
183
+ minversion = "7.0"
184
+ testpaths = ["tests"]
185
+ python_files = ["test_*.py"]
186
+ python_classes = ["Test*"]
187
+ python_functions = ["test_*"]
188
+ addopts = [
189
+ "--strict-markers",
190
+ "--strict-config",
191
+ "--tb=short",
192
+ "--durations=10",
193
+ ]
194
+ markers = [
195
+ "unit: Unit tests - fast, isolated",
196
+ "functional: Functional end-to-end tests",
197
+ "integration: Integration tests - cross-component",
198
+ "performance: Performance benchmarks",
199
+ "rocksdb: RocksDB tests",
200
+ "slow: Slow-running tests",
201
+ ]
202
+ filterwarnings = [
203
+ "error",
204
+ "ignore::UserWarning",
205
+ "ignore::DeprecationWarning",
206
+ ]
207
+
208
+ # ============================================================================
209
+ # Coverage
210
+ # ============================================================================
211
+ [tool.coverage.run]
212
+ source = ["src"]
213
+ omit = [
214
+ "*/tests/*",
215
+ "*/test_*",
216
+ "*/__pycache__/*",
217
+ "*/site-packages/*",
218
+ ]
219
+ branch = true
220
+
221
+ [tool.coverage.report]
222
+ exclude_lines = [
223
+ "pragma: no cover",
224
+ "def __repr__",
225
+ "def __str__",
226
+ "raise AssertionError",
227
+ "raise NotImplementedError",
228
+ "if __name__ == .__main__.:",
229
+ "if TYPE_CHECKING:",
230
+ "if typing.TYPE_CHECKING:",
231
+ "@abstractmethod",
232
+ "@abc.abstractmethod",
233
+ ]
234
+ precision = 2
235
+ show_missing = true
236
+
237
+ [tool.coverage.html]
238
+ directory = "tests/reports/coverage"
239
+
240
+ # ============================================================================
241
+ # Linting & Formatting - Ruff
242
+ # ============================================================================
243
+ [tool.ruff]
244
+ line-length = 100
245
+ target-version = "py312"
246
+ src = ["src", "tests"]
247
+ extend-exclude = [
248
+ ".venv",
249
+ "build",
250
+ "dist",
251
+ "*.egg-info",
252
+ "*.c",
253
+ "*.cpp",
254
+ "*.so",
255
+ ]
256
+
257
+ [tool.ruff.lint]
258
+ select = [
259
+ "E", # pycodestyle errors
260
+ "W", # pycodestyle warnings
261
+ "F", # pyflakes
262
+ "I", # isort
263
+ "B", # flake8-bugbear
264
+ "C4", # flake8-comprehensions
265
+ "UP", # pyupgrade
266
+ "N", # pep8-naming
267
+ "YTT", # flake8-2020
268
+ "S", # flake8-bandit (security)
269
+ "T20", # flake8-print
270
+ "D", # pydocstyle
271
+ "ANN", # flake8-annotations
272
+ "TC", # flake8-type-checking
273
+ "RUF", # ruff-specific rules
274
+ "PTH", # flake8-pathlib
275
+ ]
276
+ ignore = [
277
+ "E501", # Line too long (handled by formatter)
278
+ "D105", # Missing docstring in magic method
279
+ ]
280
+
281
+ [tool.ruff.lint.pydocstyle]
282
+ convention = "google"
283
+
284
+ [tool.ruff.lint.per-file-ignores]
285
+ "tests/**/*.py" = [
286
+ "S101", # assert allowed in tests
287
+ "T20", # print allowed in tests
288
+ "D", # docstrings not required in tests
289
+ "ANN", # type annotations not required in tests
290
+ ]
291
+ "setup.py" = [
292
+ "T20", # print allowed in setup
293
+ "D", # docstrings not required in setup
294
+ ]
295
+ "src/rdbpy/**/*.py" = [
296
+ "D", # Some docstrings may be in .pyx files
297
+ ]
298
+
299
+ [tool.ruff.lint.isort]
300
+ known-first-party = ["rdbpy"]
301
+ force-single-line = false
302
+ lines-after-imports = 2
303
+
304
+ [tool.ruff.format]
305
+ quote-style = "double"
306
+ indent-style = "space"
307
+ skip-magic-trailing-comma = false
308
+ line-ending = "auto"
309
+ docstring-code-format = true
310
+ docstring-code-line-length = 80
311
+
312
+ # ============================================================================
313
+ # Type Checking - mypy
314
+ # ============================================================================
315
+ [tool.mypy]
316
+ python_version = "3.12"
317
+ warn_return_any = true
318
+ warn_unused_configs = true
319
+ disallow_untyped_defs = false
320
+ ignore_missing_imports = true
321
+ exclude = [
322
+ "build/",
323
+ "dist/",
324
+ ".venv/",
325
+ ".*\\.pyx$",
326
+ ]
327
+
328
+ [[tool.mypy.overrides]]
329
+ module = "rdbpy.*"
330
+ ignore_errors = true