Skip to content

Commit ad14e68

Browse files
authored
Added poetry ruff and mypy for dependency management and linting (#16)
1 parent c976caf commit ad14e68

5 files changed

Lines changed: 6240 additions & 42 deletions

File tree

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: "v0.11.6"
4+
hooks:
5+
# Run the formatter
6+
- id: ruff-format
7+
# Run the linter
8+
- id: ruff
9+
args: [--fix]
10+
11+
- repo: https://github.com/pre-commit/mirrors-mypy
12+
rev: "v1.15.0"
13+
hooks:
14+
- id: mypy
15+
additional_dependencies: [types-requests]

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,40 @@ response, cache_hit = vectorq.create("Is the sky blue?")
3939
print(f"Response: {response}")
4040
```
4141

42+
## Development Setup
43+
44+
To set up VectorQ for development:
45+
46+
### Using Poetry
47+
48+
1. Install Poetry if you don't have it already:
49+
```bash
50+
curl -sSL https://install.python-poetry.org | python3 -
51+
```
52+
53+
2. Install dependencies:
54+
```bash
55+
poetry install --with dev,benchmarks
56+
```
57+
58+
### Setting Up Pre-commit Hooks
59+
60+
Install pre-commit hooks to ensure code quality:
61+
```bash
62+
poetry run pre-commit install
63+
```
64+
65+
The pre-commit hooks will automatically:
66+
- Format code with Ruff
67+
- Check imports
68+
- Validate Python syntax
69+
- Run type checking with mypy
70+
71+
When you commit changes, these checks will run automatically. You can also run them manually:
72+
```bash
73+
poetry run pre-commit run --all-files
74+
```
75+
4276
## Semantic Prompt Caches
4377
Semantic Prompt Caches are layered between your application server and inference server to reduce latency and cost by reusing cached responses for semantically similar prompts.
4478

0 commit comments

Comments
 (0)