Development Setup¶
Set up your development environment for contributing to GraphMem.
Prerequisites¶
- Python 3.9+
- Git
- (Optional) Docker for testing with Neo4j/Redis
Clone the Repository¶
Create Virtual Environment¶
Install Dependencies¶
Run Tests¶
# Run all tests
pytest
# Run with coverage
pytest --cov=graphmem
# Run specific test file
pytest tests/test_memory.py
Code Formatting¶
# Format code
black src/graphmem
# Check formatting
black --check src/graphmem
# Sort imports
isort src/graphmem
Linting¶
Type Checking¶
Build Documentation¶
# Install docs dependencies
pip install -r docs/requirements.txt
# Serve docs locally
mkdocs serve
# Build docs
mkdocs build
Local Services (Docker)¶
# Start Neo4j and Redis for testing
docker-compose -f docker-compose.dev.yml up -d
# Stop services
docker-compose -f docker-compose.dev.yml down
Environment Variables¶
Create a .env file for local development: