Development Setup
This guide walks you through setting up a local development environment for LineageBridge.
Prerequisites
Required
- Python 3.11 or later - Check your version:
If you need to install Python 3.11+, we recommend: - macOS: brew install python@3.11 - Linux: pyenv install 3.11.7 - Windows: Download from python.org
- uv (recommended) - Fast Python package installer:
Alternatively, you can use pip, but uv is significantly faster for dependency installation.
Optional but Recommended
- Git for version control
- Make for using Makefile targets
- Confluent Cloud account for integration testing
Installation
1. Clone the Repository
If you're contributing, fork the repository first and clone your fork:
git clone https://github.com/YOUR-USERNAME/lineage-bridge.git
cd lineage-bridge
git remote add upstream https://github.com/takabayashi/lineage-bridge.git
2. Create a Virtual Environment
We recommend using uv to create and manage your virtual environment:
Alternatively, with standard Python:
python -m venv .venv
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows
3. Install Dependencies
Install LineageBridge in editable mode with development dependencies:
This installs: - Core dependencies: httpx, networkx, pydantic, streamlit, etc. - Dev dependencies: pytest, pytest-asyncio, pytest-cov, respx, ruff
4. Verify Installation
Check that everything is installed correctly:
# Check Python package
python -c "import lineage_bridge; print(lineage_bridge.__version__)"
# Run tests to verify setup
make test
# or
uv run pytest tests/ -v
Configuration
Environment Variables
Copy the example .env file and configure your credentials:
Edit .env and add your Confluent Cloud credentials:
# Confluent Cloud credentials
LINEAGE_BRIDGE_CLOUD_API_KEY=your-cloud-api-key
LINEAGE_BRIDGE_CLOUD_API_SECRET=your-cloud-api-secret
# Optional: Databricks Unity Catalog
LINEAGE_BRIDGE_DATABRICKS_WORKSPACE_URL=https://your-workspace.cloud.databricks.com
LINEAGE_BRIDGE_DATABRICKS_TOKEN=your-databricks-token
# Optional: AWS Glue
LINEAGE_BRIDGE_AWS_REGION=us-east-1
LINEAGE_BRIDGE_AWS_GLUE_DATABASE=your-glue-database
Note: Only credentials go in .env. Environment and cluster selection happens in the UI or CLI.
Auto-Provisioning API Keys
LineageBridge can auto-provision Kafka cluster API keys using the Confluent CLI:
-
Install Confluent CLI:
-
Log in to Confluent Cloud:
-
Start the UI - it will auto-provision keys as needed:
Makefile Targets
The project includes a comprehensive Makefile for common tasks:
Development
make install # Install project with dev dependencies
make test # Run all tests
make lint # Run ruff linter
make format # Auto-format code and fix lint issues
make clean # Remove build artifacts and caches
Running
make ui # Start Streamlit UI (auto-provisions API keys)
make extract # Run CLI extraction
make watch # Run change-detection watcher
make api # Start REST API server
Documentation
make docs-serve # Serve docs locally at localhost:8001
make docs-build # Build static docs site
make docs-install # Install documentation dependencies
Docker
make docker-build # Build Docker images
make docker-ui # Start UI via Docker
make docker-extract # Run extraction via Docker
make docker-watch # Run watcher via Docker
make docker-down # Stop all Docker services
Demo Infrastructure
make demo-uc-up # Provision Unity Catalog demo
make demo-glue-up # Provision AWS Glue demo
make demo-bq-up # Provision BigQuery demo
make demo-uc-down # Tear down demo
Run make help to see all available targets.
IDE Setup
VS Code (Recommended)
Create .vscode/settings.json:
{
"python.defaultInterpreterPath": ".venv/bin/python",
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["tests/"],
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"ruff.lint.enable": true,
"ruff.format.enable": true
}
Install the Ruff extension: - Open VS Code - Go to Extensions (Cmd+Shift+X) - Search for "Ruff" by Astral Software - Install
PyCharm
- Set Python interpreter:
- File > Settings > Project > Python Interpreter
- Add Interpreter > Existing Environment
-
Select
.venv/bin/python -
Configure pytest:
- File > Settings > Tools > Python Integrated Tools
-
Default test runner: pytest
-
Configure Ruff:
- File > Settings > Tools > External Tools
- Add new tool for "Ruff Format" and "Ruff Check"
Pre-commit Hooks (Optional)
Set up automatic linting and formatting on commit:
# Create .git/hooks/pre-commit
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
set -e
echo "Running ruff format..."
uv run ruff format .
echo "Running ruff check..."
uv run ruff check --fix .
echo "Running tests..."
uv run pytest tests/ -v
EOF
chmod +x .git/hooks/pre-commit
Virtual Environment Best Practices
Activating the Environment
Always activate your virtual environment before working:
With uv, you can also run commands without activating:
Keeping Dependencies Updated
Update dependencies periodically:
Deactivating
When you're done:
Troubleshooting
"Command not found: uv"
Install uv:
Then restart your shell or run:
"No module named 'lineage_bridge'"
Make sure you installed in editable mode:
Tests fail with import errors
Reinstall dependencies:
Ruff errors on save
Make sure the Ruff extension is installed and enabled in your IDE.
"Permission denied" on Makefile
Ensure you have execution permissions:
Next Steps
- Run the test suite to verify everything works
- Add a new extractor to integrate a new data source
- Check out the main contributing guide for PR guidelines
Questions? Open a GitHub Discussion or file an issue.