# Navigate to the library
cd clgraph
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in editable mode with dev dependencies
uv pip install -e ".[dev]"# Run all tests
pytest
# Run with verbose output
pytest -v
# Run specific test file
pytest tests/test_lineage.py
# Run specific test class
pytest tests/test_lineage.py::TestQueryUnitBasics
# Run specific test
pytest tests/test_lineage.py::TestQueryUnitBasics::test_query_unit_creation# Format code
black src/ tests/
# Lint code
ruff check src/ tests/
# Type check
mypy src/# Build distribution packages
python -m build
# This creates:
# - dist/clgraph-0.1.0.tar.gz (source distribution)
# - dist/clgraph-0.1.0-py3-none-any.whl (wheel)# Install twine
pip install twine
# Check the distribution
twine check dist/*
# Upload to Test PyPI (for testing)
twine upload --repository testpypi dist/*
# Upload to PyPI (for production)
twine upload dist/*# From PyPI (once published)
pip install clgraph
# From source
pip install git+https://github.com/yourusername/clgraph.git
# For development
git clone https://github.com/yourusername/clgraph.git
cd clgraph
pip install -e .from clgraph import SQLColumnTracer
sql = """
SELECT
u.name,
o.total_amount
FROM users u
JOIN orders o ON u.id = o.user_id
"""
# Create tracer
tracer = SQLColumnTracer(sql, dialect="bigquery")
# Build lineage graph
lineage = tracer.build_column_lineage_graph()
# Query the lineage
# Note: The API is still being finalized
# Check the examples/ directory for current usage# Simple column lineage example
python examples/simple_example.py
# Multi-query pipeline example
python examples/pipeline_example.pyThe repository includes a GitHub Actions workflow (.github/workflows/test.yml) that:
- Runs tests on Python 3.9, 3.10, 3.11, 3.12
- Tests on Ubuntu, macOS, and Windows
- Runs linting and formatting checks
- Tests examples
The workflow runs automatically on:
- Pull requests to
main - Pushes to
main
# Run all checks before committing
black src/ tests/
ruff check src/ tests/
mypy src/
pytestIf you get import errors after installation:
# Make sure you're in the right directory
cd clgraph
# Reinstall in editable mode
uv pip install -e .
# Verify installation
python -c "from clgraph import SQLColumnTracer; print('Success!')"If tests fail:
# Check if dependencies are installed
uv pip list
# Reinstall dependencies
uv pip install -e ".[dev]"
# Run tests with verbose output to see details
pytest -vv# Remove and recreate virtual environment
rm -rf .venv
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"- Check out the README.md for detailed documentation
- Read the CONTRIBUTING.md for contribution guidelines
- Review the DEPLOYMENT_PLAN.md for the overall project strategy
- Explore the code in
src/clgraph/parser.py - Run the examples in
examples/ - Write your own queries and test them!