Skip to content

Commit 0044f55

Browse files
authored
Reorganize docs and switch to ruff (#804)
* Reorganize docs and switch to ruff * Add technical terms to spellcheck wordlist
1 parent 43a7d49 commit 0044f55

File tree

14 files changed

+933
-853
lines changed

14 files changed

+933
-853
lines changed

.github/wordlist.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,8 @@ UUID
125125
lexicographically
126126
Lexicographically
127127
backport
128+
TTL
129+
queryable
130+
substring
131+
NotFoundError
132+
QueryNotSupportedError

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ help:
1919
@echo " redis start a Redis instance with Docker"
2020
@echo " sync generate modules redis_om, tests_sync from aredis_om, tests respectively"
2121
@echo " dist build a redis-om package"
22+
@echo " docs start the docs server locally for preview"
2223
@echo " all equivalent to \"make lint format test\""
2324
@echo ""
2425
@echo "Check the Makefile to know exactly what each target is doing."
@@ -49,17 +50,16 @@ sync: $(INSTALL_STAMP)
4950
$(UV) run python make_sync.py
5051

5152
.PHONY: lint
52-
lint: $(INSTALL_STAMP) dist
53-
$(UV) run isort --profile=black --lines-after-imports=2 ./tests/ $(NAME) $(SYNC_NAME)
54-
$(UV) run black ./tests/ $(NAME)
55-
$(UV) run flake8 --ignore=E231,E501,E712,E731,F401,W503 ./tests/ $(NAME) $(SYNC_NAME)
53+
lint: $(INSTALL_STAMP) sync
54+
$(UV) run ruff check ./tests/ $(NAME) $(SYNC_NAME)
55+
$(UV) run ruff format --check ./tests/ $(NAME) $(SYNC_NAME)
5656
$(UV) run mypy ./tests/ --ignore-missing-imports --exclude migrate.py --exclude _compat\.py$$
5757
$(UV) run bandit -r $(NAME) $(SYNC_NAME) -s B608
5858

5959
.PHONY: format
6060
format: $(INSTALL_STAMP) sync
61-
$(UV) run isort --profile=black --lines-after-imports=2 ./tests/ $(NAME) $(SYNC_NAME)
62-
$(UV) run black ./tests/ $(NAME) $(SYNC_NAME)
61+
$(UV) run ruff check --fix ./tests/ $(NAME) $(SYNC_NAME)
62+
$(UV) run ruff format ./tests/ $(NAME) $(SYNC_NAME)
6363

6464
.PHONY: test
6565
test: $(INSTALL_STAMP) sync redis
@@ -77,5 +77,9 @@ test_oss: $(INSTALL_STAMP) sync redis
7777
redis:
7878
docker compose up -d
7979

80+
.PHONY: docs
81+
docs: $(INSTALL_STAMP)
82+
$(UV) run mkdocs serve
83+
8084
.PHONY: all
8185
all: lint format test

aredis_om/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
)
2020
from .model.types import Coordinates, GeoFilter
2121

22+
2223
# Backward compatibility alias - deprecated, use SchemaDetector or SchemaMigrator
2324
Migrator = SchemaDetector
2425

aredis_om/model/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
Union,
2525
)
2626
from typing import get_args as typing_get_args
27-
from typing import no_type_check
27+
from typing import (
28+
no_type_check,
29+
)
2830

2931
from more_itertools import ichunked
3032
from pydantic import BaseModel

docs/migrations.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ If you're upgrading from Redis OM Python 0.x to 1.0, see the **[0.x to 1.0 Migra
1818
## CLI Commands
1919

2020
```bash
21-
# Schema migrations (recommended)
2221
om migrate # File-based schema migrations with rollback support
2322
om migrate-data # Data migrations and transformations
24-
25-
# Legacy command (deprecated)
26-
migrate # Automatic schema migrations (use om migrate instead)
2723
```
2824

2925
## Schema Migrations
@@ -57,24 +53,6 @@ om migrate run
5753
om migrate run --migrations-dir myapp/schema-migrations
5854
```
5955

60-
> **Note**: The legacy `migrate` command performs automatic migrations without file tracking and is deprecated. Use `om migrate` for production deployments.
61-
62-
### Migration Approaches
63-
64-
Redis OM provides two approaches to schema migrations:
65-
66-
#### File-based Migrations (`om migrate`) - Recommended
67-
- **Controlled**: Migrations are saved as versioned files
68-
- **Rollback**: Previous schemas can be restored
69-
- **Team-friendly**: Migration files can be committed to git
70-
- **Production-safe**: Explicit migration approval workflow
71-
72-
#### Automatic Migrations (`migrate`) - Deprecated
73-
- **Immediate**: Detects and applies changes instantly
74-
- **No rollback**: Cannot undo schema changes
75-
- **Development-only**: Suitable for rapid prototyping
76-
- **⚠️ Deprecated**: Use `om migrate` for production
77-
7856
### How File-based Migration Works
7957

8058
1. **Detection**: Auto-migrator detects index changes from your models

0 commit comments

Comments
 (0)