Prerequisites
Ensure you have the following installed:- Python: 3.12 or higher (< 3.14)
- uv: Fast Python package manager (install instructions)
- just: Command runner (optional, but recommended)
Installing just
Installation
Install dependencies
Install the package in editable mode with development dependencies:This installs:
- The
syft-flwrpackage in editable mode - All development dependencies including pytest, pre-commit, jupyter, and more
Verify Installation
Verify your setup is working correctly:Development Dependencies
The development environment includes the following tools:Testing
Testing
- pytest: Testing framework
- pytest-cov: Code coverage reporting
- pytest-xdist: Parallel test execution
- pytest-asyncio: Async test support
Code Quality
Code Quality
- ruff: Fast Python linter and formatter
- pre-commit: Git hook framework for automated checks
Development Tools
Development Tools
- ipykernel: Jupyter kernel support
- ipywidgets: Interactive widgets for notebooks
- jupyterlab: Interactive development environment
- python-dotenv: Environment variable management
Build & Release
Build & Release
- commitizen: Conventional commits and version bumping
- torch: PyTorch for ML model training
- imblearn: Imbalanced learning utilities
Google OAuth Setup (for Integration Tests)
Integration tests use Google Drive as the transport layer and require OAuth credentials. This setup is optional and only needed if you plan to run integration tests locally.Create Google Cloud Project
- Go to Google Cloud Console
- Create a new project (or select existing one)
- Note your project name for later
Enable Google Drive API
- Go to “APIs & Services” → “Library”
- Search for “Google Drive API”
- Click “Enable”
Configure OAuth Consent Screen
- Go to “APIs & Services” → “OAuth consent screen”
- Choose “External” (or “Internal” if using Google Workspace)
- Fill in required fields:
- App name (e.g., “SyftBox Integration Tests”)
- User support email
- Developer contact email
- Add scopes:
https://www.googleapis.com/auth/drive - Add your test user emails (DO1, DO2, DS emails)
- Save
Publish OAuth App
To make tokens persistent (not expire after 7 days):
- Go to “APIs & Services” → “OAuth consent screen” → “Audience”
- Click “PUBLISH APP”
- Confirm the prompt
While in “Testing” mode, OAuth tokens expire after 7 days. Publishing prevents this expiration.
Create OAuth Credentials
Create credentials for each participant (DO1, DO2, DS):
- Go to “APIs & Services” → “Credentials”
- Click “Create Credentials” → “OAuth client ID”
- Application type: Desktop app
- Name it (e.g., “DO1 Client”, “DO2 Client”, “DS Client”)
- Click “Create”
- Download the JSON file
- Save as
do1.json,do2.json, ords.jsonincredentials/
Required Files Structure
Security Notes
Next Steps
Now that your environment is set up:- Learn about Testing to run unit and integration tests
- Review Code Quality guidelines
- Understand the Release Process