This guide explains how to set up the WhoisMCP development environment using uv.
uv is an extremely fast Python package installer and resolver, written in Rust. It's 10-100x faster than pip and provides better dependency resolution.
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or with pip (slower)
pip install uv# Clone the repository
git clone https://github.com/yourusername/whoismcp.git
cd whoismcp
# Create a virtual environment with uv
uv venv
# Activate it
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install the package and all dependencies
uv pip install -e ".[dev]"# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=whoismcp
# Run specific test file
uv run pytest tests/test_mcp_server.py# Format code
uv run black src/ tests/
# Lint code
uv run ruff check src/ tests/
# Type checking
uv run mypy src/# Install build dependencies
uv pip install pyinstaller
# Run build script
python scripts/build.py# Add a new dependency
uv pip install some-package
# Then update pyproject.toml manually
# Sync environment with pyproject.toml
uv pip sync
# Upgrade all dependencies
uv pip install -e ".[dev]" --upgrade# uv creates venvs in .venv by default
uv venv
# Or specify Python version
uv venv --python 3.11If you have a requirements file:
uv pip install -r requirements.txt# Generate requirements from current environment
uv pip freeze > requirements.txt
# Or better, use pip-tools format
uv pip compile pyproject.toml -o requirements.txtThe GitHub Actions workflow is already configured to use uv. For other CI systems:
# Example: GitLab CI
before_script:
- curl -LsSf https://astral.sh/uv/install.sh | sh
- source $HOME/.cargo/env
- uv venv
- source .venv/bin/activate
- uv pip install -e ".[dev]"Typical installation times for this project:
pip install -e ".[dev]": ~30-60 secondsuv pip install -e ".[dev]": ~2-5 seconds
Make sure ~/.cargo/bin is in your PATH:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcUse --user flag or ensure you're in a virtual environment:
uv pip install --user pyinstallerClear uv cache if needed:
uv cache cleanFor reproducible builds:
uv pip compile pyproject.toml --generate-hashes -o requirements.lockuv pip install --index-url https://pypi.org/simple/ package-name# Download packages first
uv pip download -r requirements.txt -d ./offline
# Install offline
uv pip install --find-links ./offline -r requirements.txtAdd to .vscode/settings.json:
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.linting.enabled": true,
"python.linting.ruffEnabled": true,
"python.formatting.provider": "black"
}If using pre-commit:
# Install pre-commit
uv pip install pre-commit
# Install hooks
pre-commit install
# Run manually
pre-commit run --all-files