Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 2.63 KB

File metadata and controls

85 lines (61 loc) · 2.63 KB

Contributing to uproot

Thank you for your interest in contributing to uproot! This guide will help you get started with development.

Development Setup

  1. Clone the repository:

    git clone https://github.com/mrpg/uproot.git
    cd uproot
  2. Install development dependencies:

    make install

    This will:

    • Install the package in editable mode with all dev dependencies
    • Set up pre-commit hooks automatically

    Requires uv. See the README for installation instructions.

Development Workflow

Running Checks Locally

Before committing, ensure your code passes all checks:

# Run all checks at once
make all

# Or run individual checks:
make format          # Auto-format code (black, isort, ruff --fix)
make lint            # Check code style (ruff, black, isort)
make type-check      # Run mypy type checking
make security        # Run security scans (bandit, pip-audit, semgrep)
make quality         # Run code quality checks (radon, deptry)
make test            # Run tests with coverage

See all available commands with make help.

Pre-commit Hooks

Pre-commit hooks are automatically installed with make install. To manually run them on all files:

pre-commit run --all-files

Development Tools

We use the following tools to maintain code quality:

Code Quality

  • Black: Code formatting
  • isort: Import sorting (Black profile)
  • Ruff: Fast Python linting
  • mypy: Static type checking
  • Radon: Code complexity analysis

Security

  • Bandit: Security vulnerability detection
  • pip-audit: Dependency CVE scanning
  • Deptry: Unused/missing dependency detection

Testing

  • pytest: Testing framework with coverage reporting
  • pytest-asyncio: Async code testing
  • pytest-cov: Coverage reports with missing line identification

Automation

  • Pre-commit hooks: Automated checks before each commit
  • GitHub Actions: CI/CD workflow on pull requests
  • Make targets: Convenient commands for common tasks

Standards

  • Python version: Minimum Python 3.11 required
  • Database support: Optional PostgreSQL support via psycopg
  • Versioning: Semantic versioning (MAJOR.MINOR.PATCH)

All development dependencies are included in the [dev] optional dependency group.