First, install the uv package manager:
- macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh- Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Use uv sync to install dependencies. Choose your configuration based on your needs:
- Base installation (only essential dependencies):
uv sync --no-group- Full standard installation (base + testing + linting):
uv sync- ML-specific installation (includes ML libraries and above):
uv sync --group ml- Documentation generation installation (includes ML and documentation libraries):
uv sync --group ml --group docs- All packages (complete environment including tests, development tools, and documentation):
uv sync --all-groupsRun project commands via uv run --:
uv run -- <command>Examples:
- Run Ruff formatter:
uv run -- ruff check . uv run -- ruff check --fix .- Run Flower:
uv run -- flwr runAutomated tests use pytest. Execute the full test suite with:
uv run pytest tests/unitRequires Anvil installed.
uv run pytest tests/integrationRun specific tests with:
uv run -- pytest path/to/test_exampleProject linting and formatting are handled by Ruff:
uv run -- ruff check --fix .
uv run -- ruff formatFor smoother workflow in VSCode:
- Install the Ruff extension.
- Enable "formatting on save" by navigating to Settings (Ctrl+,), search for
ruff save, and toggle it on.
Check the examples directory for detailed instructions on running specific examples.
Documentation is generated using Sphinx and written in reStructuredText (reST). To build and preview documentation locally:
cd sphinx
uv run -- sphinx-autobuild source build/htmlAccess the generated documentation via http://localhost:8000 in your browser.