Development Requirements
Before you begin contributing to the Redis Message Queue Backend, ensure your development environment meets these requirements.
Software Prerequisites
Required Software
- Python: Python 3.12 or 3.13
- Git: Latest stable version
- uv: Fast Python package manager (recommended) or pip
- Redis: Version 6.0+ for testing (7.0+ recommended)
- Docker: For running Redis in containers during testing (optional)
Recommended Development Tools
- Visual Studio Code or PyCharm: IDE with Python support
- RedisInsight: GUI for debugging Redis streams
- pre-commit: For running pre-commit hooks automatically
Python Dependencies
The project dependencies are managed in pyproject.toml
:
Production Dependencies
- redis[hiredis]>=6.4.0: Redis client with high-performance parser
- slack-mcp>=0.0.1: Slack MCP Server core library
Development Dependencies
- pytest: Testing framework
- pytest-asyncio: Async test support
- pytest-cov: Code coverage reporting
- pytest-rerunfailures: Retry flaky tests
- testcontainers[redis]: Docker-based Redis for integration tests
- black: Code formatting
- pylint: Code linting
- mypy: Static type checking
- python-dotenv: Environment variable management
Development Environment Setup
1. Clone the Repository
git clone https://github.com/Chisanan232/MCP-BackEnd-Message-Queue-Redis.git
cd MCP-BackEnd-Message-Queue-Redis
2. Install uv (Recommended)
- macOS/Linux
- Windows
- pip
curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
pip install uv
3. Set Up Development Environment
- uv (Recommended)
- pip
# Install all dependencies including dev tools
uv sync
# Activate virtual environment (optional, uv run handles this)
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windows
# Create virtual environment
python -m venv venv
source venv/bin/activate # macOS/Linux
# or venv\Scripts\activate # Windows
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
4. Start Redis for Testing
- Docker (Recommended)
- Local Installation
docker run -d --name redis-dev -p 6379:6379 redis:7-alpine
# Verify it's running
docker exec redis-dev redis-cli ping
# macOS
brew services start redis
# Linux
sudo systemctl start redis-server
# Verify Redis is running
redis-cli ping # Should return "PONG"
5. Set Up Pre-commit Hooks
uv run pre-commit install
# Test pre-commit setup
uv run pre-commit run --all-files
6. Configure Environment Variables
Create a .env
file for local development:
# .env
REDIS_URL=redis://localhost:6379/0
QUEUE_BACKEND=redis
7. Run Tests to Verify Setup
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=slack_mcp_plugin --cov-report=html
# Run only unit tests
uv run pytest test/unit_test/
# Run only integration tests (requires Redis)
uv run pytest test/integration_test/
Development Commands
Running Tests
# All tests
uv run pytest
# Specific test file
uv run pytest test/unit_test/test_redis_backend.py
# With verbose output
uv run pytest -v
# With coverage report
uv run pytest --cov=slack_mcp_plugin --cov-report=term-missing
Code Quality
# Format code
uv run black slack_mcp_plugin/ test/
# Lint code
uv run pylint slack_mcp_plugin/
# Type checking
uv run mypy slack_mcp_plugin/
# Run all pre-commit hooks
uv run pre-commit run --all-files
Building Documentation
cd docs
npm install
npm start # Development server
npm run build # Production build
Next Steps
Once your development environment is set up:
- Read the Development Workflow guide
- Review the Coding Style guidelines
- Check out the CI/CD documentation
- Start contributing!