Development Setup
Prerequisites
- Docker: Required for all development workflows
- Git: For version control
- VS Code: Optional but recommended
Setup Options
Option 1: VS Code Dev Containers (Recommended)
- Open the project in VS Code
- Install the "Dev Containers" extension
- Press
Cmd/Ctrl + Shift + P→ "Dev Containers: Reopen in Container"
The devcontainer includes Python 3.11, Redis, and all dependencies pre-installed.
Option 2: Docker Compose
Run tests:
docker compose -f tests/docker-compose.yaml up --build --abort-on-container-exit --exit-code-from test
Reformat code:
Validate docs:
Option 3: Virtual Environment
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install --upgrade pip
pip install -e .
pip install -e .[test]
pip install -e .[dev]
pip install -e .[docs]
Start a Redis or DragonflyDB backend:
Verifying Your Setup
from synced_memory.redis import Memory # Redis
from synced_memory.dragonflydb import Memory # DragonflyDB
mem = Memory()
mem.test = "Hello, synced-memory!"
print(mem.test) # Hello, synced-memory!
Run the test suite:
Project Structure
synced-memory/
├── .devcontainer/ # Dev container configuration
├── .github/workflows/ci.yaml
├── .vscode/tasks.json
├── docs/ # Documentation source
├── docs-validate/ # Docs validation Docker setup
├── lint/ # Linting Docker setup
├── reformat/ # Code formatting Docker setup
├── scripts/ # Utility scripts
├── src/
│ └── synced_memory/
│ ├── __init__.py # Package re-exports
│ ├── common.py # Shared business logic
│ ├── redis/
│ │ └── __init__.py # Redis backend (thin wrapper)
│ └── dragonflydb/
│ └── __init__.py # DragonflyDB backend (thin wrapper)
├── tests/
│ ├── test_redis.py # Redis test suite
│ └── docker-compose.yaml # Test environment (Redis + DragonflyDB)
├── mkdocs.yml
└── pyproject.toml
Common Issues
Redis Connection Error:
- Ensure Redis is running: redis-cli ping should return PONG
- Check REDIS_HOST environment variable
Import Error (ModuleNotFoundError: No module named 'synced_memory'):
Port already in use (6379):