Skip to content

Commit 68eb13e

Browse files
committed
chore: setup development tooling and pre-commit hooks
1 parent 7e2cf58 commit 68eb13e

File tree

6 files changed

+190
-1
lines changed

6 files changed

+190
-1
lines changed

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: check-toml
11+
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.0
14+
hooks:
15+
- id: ruff
16+
args: [--fix]
17+
- id: ruff-format
18+
19+
- repo: https://github.com/pre-commit/mirrors-mypy
20+
rev: v1.8.0
21+
hooks:
22+
- id: mypy
23+
args: [--ignore-missing-imports]

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,29 @@ client.close()
6262
## How it works
6363
`SQLiteVecClient` stores data in `{table}` and mirrors embeddings in `{table}_vec` (a `vec0` virtual table). SQLite triggers keep both in sync when rows are inserted, updated, or deleted. Embeddings are serialized as packed float32 bytes for compact storage.
6464

65+
## Development
66+
67+
Install development dependencies:
68+
```bash
69+
pip install -r requirements-dev.txt
70+
pre-commit install
71+
```
72+
73+
Run tests:
74+
```bash
75+
pytest --cov=sqlite_vec_client
76+
```
77+
78+
Format and lint:
79+
```bash
80+
ruff check .
81+
ruff format .
82+
mypy sqlite_vec_client/
83+
```
84+
6585
## Contributing
6686
Contributions are very welcome—issues, ideas, and PRs help this project grow!
6787

6888
## License
6989

70-
MIT
90+
MIT

TODO

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# TODO List - sqlite-vec-client
2+
3+
## 🔴 Critical Priority (Security & Stability)
4+
5+
### Security
6+
- [ ] Fix SQL injection vulnerability (table name sanitization)
7+
- [ ] Add table name validation (alphanumeric and underscore only)
8+
- [ ] Add input validation (dim, top_k, limit, etc.)
9+
10+
### Error Handling
11+
- [ ] Create custom exception classes (VecClientError, TableNotFoundError, etc.)
12+
- [ ] Add exception handling to all public methods
13+
- [ ] Write user-friendly error messages
14+
- [ ] Improve connection error handling
15+
16+
## 🟡 High Priority (Quality & Reliability)
17+
18+
### Test Suite
19+
- [ ] Setup pytest and configuration
20+
- [ ] Unit tests (utils, types)
21+
- [ ] Integration tests (SQLiteVecClient)
22+
- [ ] Edge case tests
23+
- [ ] Create fixtures
24+
- [ ] Target 80%+ test coverage
25+
- [ ] Mock tests (sqlite-vec extension)
26+
27+
### Examples
28+
- [ ] examples/basic_usage.py
29+
- [ ] examples/metadata_filtering.py
30+
- [ ] examples/batch_operations.py
31+
- [ ] examples/context_manager.py
32+
- [ ] examples/real_world_scenario.py
33+
34+
### Documentation
35+
- [ ] Create CONTRIBUTING.md
36+
- [ ] Start CHANGELOG.md
37+
- [ ] API reference documentation (Sphinx or MkDocs)
38+
- [ ] Migration guide (for version updates)
39+
- [ ] Add troubleshooting section
40+
41+
## 🟢 Medium Priority (Development & Tooling)
42+
43+
### Packaging & Tooling
44+
- [ ] Migrate from setup.py to pyproject.toml
45+
- [x] Add mypy configuration
46+
- [x] Add ruff or black formatter
47+
- [x] Configure pre-commit hooks
48+
- [x] Create requirements-dev.txt
49+
50+
### CI/CD
51+
- [ ] GitHub Actions workflow (.github/workflows/test.yml)
52+
- [ ] Automated test execution
53+
- [ ] Code coverage reporting
54+
- [ ] Automated PyPI publishing
55+
- [ ] Linting and type checking
56+
57+
### Logging
58+
- [ ] Python logging module integration
59+
- [ ] Log level configuration
60+
- [ ] Debug mode support
61+
- [ ] Query logging (optional)
62+
63+
## 🔵 Low Priority (New Features)
64+
65+
### Performance
66+
- [ ] Connection pooling support
67+
- [ ] Batch update operation
68+
- [ ] Lazy loading option
69+
- [ ] Index strategy documentation
70+
- [ ] Benchmark tests
71+
72+
### New Features
73+
- [ ] Partial search on JSON metadata (JSON_EXTRACT)
74+
- [ ] Metadata field filtering (key-value based)
75+
- [ ] Transaction context manager
76+
- [ ] Async/await support (aiosqlite)
77+
- [ ] Export/import functions (JSON, CSV)
78+
- [ ] Table migration utilities
79+
- [ ] Backup/restore functions
80+
81+
### API Improvements
82+
- [ ] Optimized methods for bulk operations
83+
- [ ] Streaming results (generator pattern)
84+
- [ ] Custom distance metric support
85+
- [ ] Multi-vector support (multiple embedding fields)
86+
- [ ] Soft delete support
87+
88+
## 📝 Documentation Improvements
89+
90+
- [ ] Add badges to README (PyPI, tests, coverage, license)
91+
- [ ] Publish performance benchmarks
92+
- [ ] Comparison with alternatives (Chroma, Qdrant, etc.)
93+
- [ ] Add architecture diagram
94+
- [ ] Video tutorial or blog post
95+
96+
## 🔧 Technical Debt
97+
98+
- [ ] Make type hints more specific (Generic types)
99+
- [ ] Warning system for deprecated methods
100+
- [ ] Define versioning strategy (semantic versioning)
101+
- [ ] Migration path for breaking changes
102+
- [ ] Create code review checklist
103+
104+
## 📊 Metrics & Monitoring
105+
106+
- [ ] Code coverage tracking
107+
- [ ] Performance metrics
108+
- [ ] Download statistics (PyPI)
109+
- [ ] Issue response time tracking
110+
- [ ] Community engagement metrics
111+
112+
---
113+
114+
## Notes
115+
116+
- Mark tasks with [x] when completed
117+
- New tasks can be added
118+
- Priorities may change
119+
- Create separate branch for each major task
120+
- Update this file in PRs

mypy.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mypy]
2+
python_version = 3.9
3+
warn_return_any = True
4+
warn_unused_configs = True
5+
disallow_untyped_defs = False
6+
ignore_missing_imports = True

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[tool.ruff]
2+
line-length = 88
3+
target-version = "py39"
4+
5+
[tool.ruff.lint]
6+
select = ["E", "F", "I", "N", "W", "UP"]
7+
ignore = []
8+
9+
[tool.ruff.lint.per-file-ignores]
10+
"__init__.py" = ["F401"]
11+
12+
[tool.ruff.format]
13+
quote-style = "double"
14+
indent-style = "space"
15+
line-ending = "auto"

requirements-dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pre-commit>=3.6.0
2+
ruff>=0.3.0
3+
mypy>=1.8.0
4+
pytest>=8.0.0
5+
pytest-cov>=4.1.0

0 commit comments

Comments
 (0)