rdbpython 0.0.1__tar.gz → 0.2.2__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.
- rdbpython-0.2.2/LICENSE.md +21 -0
- rdbpython-0.2.2/MANIFEST.in +86 -0
- rdbpython-0.2.2/PKG-INFO +103 -0
- rdbpython-0.2.2/README.md +57 -0
- rdbpython-0.2.2/pyproject.toml +333 -0
- rdbpython-0.2.2/scripts/build-rocksdb-linux.sh +238 -0
- rdbpython-0.2.2/scripts/build-rocksdb-macos.sh +218 -0
- rdbpython-0.2.2/scripts/rocksdb-cstdint.patch +10 -0
- rdbpython-0.2.2/setup.py +359 -0
- rdbpython-0.2.2/src/rdbpy/__init__.py +1 -0
- rdbpython-0.2.2/src/rdbpy/backup.pxd +35 -0
- rdbpython-0.2.2/src/rdbpy/cache.pxd +8 -0
- rdbpython-0.2.2/src/rdbpy/comparator.pxd +23 -0
- rdbpython-0.2.2/src/rdbpy/db.pxd +230 -0
- rdbpython-0.2.2/src/rdbpy/env.pxd +5 -0
- rdbpython-0.2.2/src/rdbpy/errors.py +26 -0
- rdbpython-0.2.2/src/rdbpy/filter_policy.pxd +39 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/comparator_wrapper.hpp +63 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/filter_policy_wrapper.hpp +89 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/memtable_factories.hpp +15 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/merge_operator_wrapper.hpp +132 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/slice_transform_wrapper.hpp +109 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/utils.hpp +8 -0
- rdbpython-0.2.2/src/rdbpy/include/rdb_include/write_batch_iter_helper.hpp +65 -0
- rdbpython-0.2.2/src/rdbpy/interfaces.py +77 -0
- rdbpython-0.2.2/src/rdbpy/iterator.pxd +16 -0
- rdbpython-0.2.2/src/rdbpy/lib_rocksdb.pxd +768 -0
- rdbpython-0.2.2/src/rdbpy/lib_rocksdb.pyi +1465 -0
- rdbpython-0.2.2/src/rdbpy/lib_rocksdb.pyx +3231 -0
- rdbpython-0.2.2/src/rdbpy/lib_utils.py +52 -0
- rdbpython-0.2.2/src/rdbpy/logger.pxd +5 -0
- rdbpython-0.2.2/src/rdbpy/memtablerep.pxd +12 -0
- rdbpython-0.2.2/src/rdbpy/merge_operator.pxd +46 -0
- rdbpython-0.2.2/src/rdbpy/merge_operators.py +25 -0
- rdbpython-0.2.2/src/rdbpy/options.pxd +179 -0
- rdbpython-0.2.2/src/rdbpy/slice_.pxd +20 -0
- rdbpython-0.2.2/src/rdbpy/slice_transform.pxd +37 -0
- rdbpython-0.2.2/src/rdbpy/snapshot.pxd +3 -0
- rdbpython-0.2.2/src/rdbpy/status.pxd +15 -0
- rdbpython-0.2.2/src/rdbpy/std_memory.pxd +7 -0
- rdbpython-0.2.2/src/rdbpy/table_factory.pxd +50 -0
- rdbpython-0.2.2/src/rdbpy/transaction.pxd +154 -0
- rdbpython-0.2.2/src/rdbpy/universal_compaction.pxd +15 -0
- rdbpython-0.2.2/src/rdbpython.egg-info/PKG-INFO +103 -0
- rdbpython-0.2.2/src/rdbpython.egg-info/SOURCES.txt +54 -0
- rdbpython-0.2.2/src/rdbpython.egg-info/requires.txt +19 -0
- rdbpython-0.2.2/src/rdbpython.egg-info/top_level.txt +1 -0
- rdbpython-0.2.2/tests/conftest.py +11 -0
- rdbpython-0.2.2/tests/functional/__init__.py +0 -0
- rdbpython-0.2.2/tests/functional/test_db.py +670 -0
- rdbpython-0.2.2/tests/functional/test_memtable.py +30 -0
- rdbpython-0.2.2/tests/functional/test_options.py +171 -0
- rdbpython-0.2.2/tests/functional/test_transaction.py +116 -0
- rdbpython-0.0.1/PKG-INFO +0 -22
- rdbpython-0.0.1/rdbpython.egg-info/PKG-INFO +0 -22
- rdbpython-0.0.1/rdbpython.egg-info/SOURCES.txt +0 -5
- rdbpython-0.0.1/setup.py +0 -19
- {rdbpython-0.0.1 → rdbpython-0.2.2}/setup.cfg +0 -0
- {rdbpython-0.0.1 → rdbpython-0.2.2/src}/rdbpython.egg-info/dependency_links.txt +0 -0
- /rdbpython-0.0.1/rdbpython.egg-info/top_level.txt → /rdbpython-0.2.2/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
|
rdbpython-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rdbpython
|
|
3
|
+
Version: 0.2.2
|
|
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
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
32
|
+
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
33
|
+
Provides-Extra: test
|
|
34
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
35
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
36
|
+
Requires-Dist: pytest-xdist>=3.0.0; extra == "test"
|
|
37
|
+
Requires-Dist: pytest-timeout>=2.1.0; extra == "test"
|
|
38
|
+
Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
|
|
39
|
+
Requires-Dist: hypothesis>=6.0.0; extra == "test"
|
|
40
|
+
Provides-Extra: cython
|
|
41
|
+
Requires-Dist: Cython>=3.0.0; extra == "cython"
|
|
42
|
+
Requires-Dist: setuptools>=68.0; extra == "cython"
|
|
43
|
+
Provides-Extra: all
|
|
44
|
+
Requires-Dist: rdbpy[cython,dev,test]; extra == "all"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# rdbpy
|
|
48
|
+
|
|
49
|
+
[](https://github.com/everyabc/rdbpy/actions/workflows/build.yml)
|
|
50
|
+
[](https://github.com/everyabc/rdbpy/actions/workflows/test.yml)
|
|
51
|
+
[](https://pypi.org/project/rdbpython/)
|
|
52
|
+
[](https://pypi.org/project/rdbpython/)
|
|
53
|
+
[](https://opensource.org/licenses/MIT)
|
|
54
|
+
|
|
55
|
+
Python bindings for RocksDB with Cython - **batteries included!**
|
|
56
|
+
|
|
57
|
+
**No RocksDB installation required** - everything is bundled in the wheel for Linux and macOS (Intel + Apple Silicon).
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install rdbpython
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
That's it! No need to install RocksDB or any compression libraries manually.
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import rdbpy
|
|
71
|
+
|
|
72
|
+
# Open database
|
|
73
|
+
options = rdbpy.Options(create_if_missing=True)
|
|
74
|
+
db = rdbpy.DB('/path/to/db', options)
|
|
75
|
+
|
|
76
|
+
# Put/Get
|
|
77
|
+
db.put(b'key', b'value')
|
|
78
|
+
value = db.get(b'key')
|
|
79
|
+
|
|
80
|
+
# Iterate
|
|
81
|
+
it = db.iterkeys()
|
|
82
|
+
it.seek_to_first()
|
|
83
|
+
while it.valid():
|
|
84
|
+
print(it.key())
|
|
85
|
+
it.next()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Development
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Setup
|
|
92
|
+
make install
|
|
93
|
+
|
|
94
|
+
# Build
|
|
95
|
+
make build
|
|
96
|
+
|
|
97
|
+
# Test
|
|
98
|
+
make test
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# rdbpy
|
|
2
|
+
|
|
3
|
+
[](https://github.com/everyabc/rdbpy/actions/workflows/build.yml)
|
|
4
|
+
[](https://github.com/everyabc/rdbpy/actions/workflows/test.yml)
|
|
5
|
+
[](https://pypi.org/project/rdbpython/)
|
|
6
|
+
[](https://pypi.org/project/rdbpython/)
|
|
7
|
+
[](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,333 @@
|
|
|
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.2"
|
|
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
|
+
|
|
49
|
+
[project.urls]
|
|
50
|
+
Homepage = "https://github.com/everyabc/rdbpy"
|
|
51
|
+
Documentation = "https://github.com/everyabc/rdbpy#readme"
|
|
52
|
+
Repository = "https://github.com/everyabc/rdbpy"
|
|
53
|
+
Issues = "https://github.com/everyabc/rdbpy/issues"
|
|
54
|
+
PyPI = "https://pypi.org/project/rdbpython/"
|
|
55
|
+
|
|
56
|
+
[project.optional-dependencies]
|
|
57
|
+
# Development tools
|
|
58
|
+
dev = [
|
|
59
|
+
"ruff>=0.1.0",
|
|
60
|
+
"pre-commit>=3.0.0",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
# Testing
|
|
64
|
+
test = [
|
|
65
|
+
"pytest>=7.0.0",
|
|
66
|
+
"pytest-cov>=4.0.0",
|
|
67
|
+
"pytest-xdist>=3.0.0",
|
|
68
|
+
"pytest-timeout>=2.1.0",
|
|
69
|
+
"pytest-benchmark>=4.0.0",
|
|
70
|
+
"hypothesis>=6.0.0",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
# Cython build dependencies (for building from source)
|
|
74
|
+
cython = [
|
|
75
|
+
"Cython>=3.0.0",
|
|
76
|
+
"setuptools>=68.0",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
# All development dependencies
|
|
80
|
+
all = [
|
|
81
|
+
"rdbpy[dev,test,cython]",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
# ============================================================================
|
|
85
|
+
# Package Discovery
|
|
86
|
+
# ============================================================================
|
|
87
|
+
[tool.setuptools]
|
|
88
|
+
zip-safe = false
|
|
89
|
+
|
|
90
|
+
[tool.setuptools.packages.find]
|
|
91
|
+
where = ["src"]
|
|
92
|
+
include = ["rdbpy*"]
|
|
93
|
+
namespaces = false
|
|
94
|
+
|
|
95
|
+
[tool.setuptools.package-data]
|
|
96
|
+
rdbpy = [
|
|
97
|
+
"**/*.pyx",
|
|
98
|
+
"**/*.pxd",
|
|
99
|
+
"**/*.hpp",
|
|
100
|
+
"py.typed",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[tool.setuptools.exclude-package-data]
|
|
104
|
+
"*" = ["*.c", "*.cpp"]
|
|
105
|
+
|
|
106
|
+
# ============================================================================
|
|
107
|
+
# CI/CD - cibuildwheel configuration
|
|
108
|
+
# ============================================================================
|
|
109
|
+
[tool.cibuildwheel]
|
|
110
|
+
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
|
|
111
|
+
|
|
112
|
+
skip = [
|
|
113
|
+
"*-musllinux_*",
|
|
114
|
+
"*-win32",
|
|
115
|
+
"*-manylinux_i686",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
build-verbosity = 1
|
|
119
|
+
|
|
120
|
+
test-command = "python -c \"import rdbpy; print('rdbpy imported successfully')\""
|
|
121
|
+
test-requires = ["pytest"]
|
|
122
|
+
|
|
123
|
+
# ============================================================================
|
|
124
|
+
# Linux-specific cibuildwheel settings
|
|
125
|
+
# ============================================================================
|
|
126
|
+
[tool.cibuildwheel.linux]
|
|
127
|
+
manylinux-x86_64-image = "manylinux2014"
|
|
128
|
+
manylinux-aarch64-image = "manylinux2014"
|
|
129
|
+
|
|
130
|
+
before-all = [
|
|
131
|
+
"yum install -y wget gcc gcc-c++ make",
|
|
132
|
+
"bash {project}/scripts/build-rocksdb-linux.sh"
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
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" }
|
|
136
|
+
|
|
137
|
+
repair-wheel-command = "LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs"
|
|
138
|
+
|
|
139
|
+
test-command = [
|
|
140
|
+
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
|
|
141
|
+
"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')\""
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
# ============================================================================
|
|
145
|
+
# macOS-specific cibuildwheel settings
|
|
146
|
+
# ============================================================================
|
|
147
|
+
[tool.cibuildwheel.macos]
|
|
148
|
+
archs = ["x86_64", "arm64"]
|
|
149
|
+
|
|
150
|
+
environment = { MACOSX_DEPLOYMENT_TARGET="10.14", RDBPY_DEP_DIR="/tmp/rdbpy_deps", DYLD_LIBRARY_PATH="/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH" }
|
|
151
|
+
|
|
152
|
+
before-all = [
|
|
153
|
+
"bash {project}/scripts/build-rocksdb-macos.sh"
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
|
|
157
|
+
|
|
158
|
+
test-command = [
|
|
159
|
+
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
|
|
160
|
+
"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')\""
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
# ============================================================================
|
|
164
|
+
# Windows-specific cibuildwheel settings
|
|
165
|
+
# ============================================================================
|
|
166
|
+
[tool.cibuildwheel.windows]
|
|
167
|
+
before-all = [
|
|
168
|
+
"powershell -File {project}/scripts/build-rocksdb-windows.ps1"
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
environment = { RDBPY_DEP_DIR="C:\\rdbpy_deps" }
|
|
172
|
+
|
|
173
|
+
test-command = [
|
|
174
|
+
"python -c \"import rdbpy; print('rdbpy imported successfully')\"",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
# ============================================================================
|
|
178
|
+
# Testing - pytest
|
|
179
|
+
# ============================================================================
|
|
180
|
+
[tool.pytest.ini_options]
|
|
181
|
+
minversion = "7.0"
|
|
182
|
+
testpaths = ["tests"]
|
|
183
|
+
python_files = ["test_*.py"]
|
|
184
|
+
python_classes = ["Test*"]
|
|
185
|
+
python_functions = ["test_*"]
|
|
186
|
+
addopts = [
|
|
187
|
+
"--strict-markers",
|
|
188
|
+
"--strict-config",
|
|
189
|
+
"--tb=short",
|
|
190
|
+
"--durations=10",
|
|
191
|
+
]
|
|
192
|
+
markers = [
|
|
193
|
+
"unit: Unit tests - fast, isolated",
|
|
194
|
+
"functional: Functional end-to-end tests",
|
|
195
|
+
"integration: Integration tests - cross-component",
|
|
196
|
+
"performance: Performance benchmarks",
|
|
197
|
+
"rocksdb: RocksDB tests",
|
|
198
|
+
"slow: Slow-running tests",
|
|
199
|
+
]
|
|
200
|
+
filterwarnings = [
|
|
201
|
+
"error",
|
|
202
|
+
"ignore::UserWarning",
|
|
203
|
+
"ignore::DeprecationWarning",
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
# ============================================================================
|
|
207
|
+
# Coverage
|
|
208
|
+
# ============================================================================
|
|
209
|
+
[tool.coverage.run]
|
|
210
|
+
source = ["src"]
|
|
211
|
+
omit = [
|
|
212
|
+
"*/tests/*",
|
|
213
|
+
"*/test_*",
|
|
214
|
+
"*/__pycache__/*",
|
|
215
|
+
"*/site-packages/*",
|
|
216
|
+
]
|
|
217
|
+
branch = true
|
|
218
|
+
|
|
219
|
+
[tool.coverage.report]
|
|
220
|
+
exclude_lines = [
|
|
221
|
+
"pragma: no cover",
|
|
222
|
+
"def __repr__",
|
|
223
|
+
"def __str__",
|
|
224
|
+
"raise AssertionError",
|
|
225
|
+
"raise NotImplementedError",
|
|
226
|
+
"if __name__ == .__main__.:",
|
|
227
|
+
"if TYPE_CHECKING:",
|
|
228
|
+
"if typing.TYPE_CHECKING:",
|
|
229
|
+
"@abstractmethod",
|
|
230
|
+
"@abc.abstractmethod",
|
|
231
|
+
]
|
|
232
|
+
precision = 2
|
|
233
|
+
show_missing = true
|
|
234
|
+
|
|
235
|
+
[tool.coverage.html]
|
|
236
|
+
directory = "tests/reports/coverage"
|
|
237
|
+
|
|
238
|
+
# ============================================================================
|
|
239
|
+
# Linting & Formatting - Ruff
|
|
240
|
+
# ============================================================================
|
|
241
|
+
[tool.ruff]
|
|
242
|
+
line-length = 100
|
|
243
|
+
target-version = "py312"
|
|
244
|
+
src = ["src", "tests"]
|
|
245
|
+
extend-exclude = [
|
|
246
|
+
".venv",
|
|
247
|
+
"build",
|
|
248
|
+
"dist",
|
|
249
|
+
"*.egg-info",
|
|
250
|
+
"*.c",
|
|
251
|
+
"*.cpp",
|
|
252
|
+
"*.so",
|
|
253
|
+
]
|
|
254
|
+
|
|
255
|
+
[tool.ruff.lint]
|
|
256
|
+
select = [
|
|
257
|
+
"E", # pycodestyle errors
|
|
258
|
+
"W", # pycodestyle warnings
|
|
259
|
+
"F", # pyflakes
|
|
260
|
+
"I", # isort
|
|
261
|
+
"B", # flake8-bugbear
|
|
262
|
+
"C4", # flake8-comprehensions
|
|
263
|
+
"UP", # pyupgrade
|
|
264
|
+
"N", # pep8-naming
|
|
265
|
+
"YTT", # flake8-2020
|
|
266
|
+
"S", # flake8-bandit (security)
|
|
267
|
+
"T20", # flake8-print
|
|
268
|
+
"D", # pydocstyle
|
|
269
|
+
"ANN", # flake8-annotations
|
|
270
|
+
"TC", # flake8-type-checking
|
|
271
|
+
"RUF", # ruff-specific rules
|
|
272
|
+
"PTH", # flake8-pathlib
|
|
273
|
+
]
|
|
274
|
+
ignore = [
|
|
275
|
+
"E501", # Line too long (handled by formatter)
|
|
276
|
+
"D105", # Missing docstring in magic method
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
[tool.ruff.lint.pydocstyle]
|
|
280
|
+
convention = "google"
|
|
281
|
+
|
|
282
|
+
[tool.ruff.lint.per-file-ignores]
|
|
283
|
+
"tests/**/*.py" = [
|
|
284
|
+
"S101", # assert allowed in tests
|
|
285
|
+
"T20", # print allowed in tests
|
|
286
|
+
"D", # docstrings not required in tests
|
|
287
|
+
"ANN", # type annotations not required in tests
|
|
288
|
+
]
|
|
289
|
+
"bench/**/*.py" = [
|
|
290
|
+
"T20", # print allowed in benchmarks
|
|
291
|
+
"D", # docstrings not required in benchmarks
|
|
292
|
+
"ANN", # type annotations not required in benchmarks
|
|
293
|
+
]
|
|
294
|
+
"setup.py" = [
|
|
295
|
+
"T20", # print allowed in setup
|
|
296
|
+
"D", # docstrings not required in setup
|
|
297
|
+
]
|
|
298
|
+
"src/rdbpy/**/*.py" = [
|
|
299
|
+
"D", # Some docstrings may be in .pyx files
|
|
300
|
+
]
|
|
301
|
+
|
|
302
|
+
[tool.ruff.lint.isort]
|
|
303
|
+
known-first-party = ["rdbpy"]
|
|
304
|
+
force-single-line = false
|
|
305
|
+
lines-after-imports = 2
|
|
306
|
+
|
|
307
|
+
[tool.ruff.format]
|
|
308
|
+
quote-style = "double"
|
|
309
|
+
indent-style = "space"
|
|
310
|
+
skip-magic-trailing-comma = false
|
|
311
|
+
line-ending = "auto"
|
|
312
|
+
docstring-code-format = true
|
|
313
|
+
docstring-code-line-length = 80
|
|
314
|
+
|
|
315
|
+
# ============================================================================
|
|
316
|
+
# Type Checking - mypy
|
|
317
|
+
# ============================================================================
|
|
318
|
+
[tool.mypy]
|
|
319
|
+
python_version = "3.12"
|
|
320
|
+
warn_return_any = true
|
|
321
|
+
warn_unused_configs = true
|
|
322
|
+
disallow_untyped_defs = false
|
|
323
|
+
ignore_missing_imports = true
|
|
324
|
+
exclude = [
|
|
325
|
+
"build/",
|
|
326
|
+
"dist/",
|
|
327
|
+
".venv/",
|
|
328
|
+
".*\\.pyx$",
|
|
329
|
+
]
|
|
330
|
+
|
|
331
|
+
[[tool.mypy.overrides]]
|
|
332
|
+
module = "rdbpy.*"
|
|
333
|
+
ignore_errors = true
|