Skip to main content

A custom dependabot alternative for Python projects

Project description

DEPENDAPY

GitHub Actions License Python PyPI Website

Features

  • 🔍 Scan & Analyze: Recursively scans repositories for pyproject.toml files and identifies outdated dependencies
  • 🔄 Python Version Check: Ensures compatibility with the three latest Python 3 minor versions
  • 🔀 Smart PR Handling: Creates new PRs or updates existing ones to avoid duplication
  • 🛠️ uv Compatible: Works seamlessly with the modern uv package manager from astral.sh
  • 🤖 GitHub Action: Runs automatically on a schedule via GitHub Actions

Installation

From PyPI (recommended)

# With uv
uv add dependapy
# With pip
pip install dependapy

From Source (for development)

# Clone the repository
git clone https://github.com/stefanposs/dependapy.git
cd dependapy

# Install in development mode with uv
uv pip install -e .

# Or with pip
pip install -e .

Usage

Running Locally

To analyze your current repository and create pull requests for updates:

# Set your GitHub token for PR creation
export GITHUB_TOKEN=your_github_token

# Run dependapy (if installed from PyPI)
dependapy

# Or run as a module
python -m dependapy.main

If you're using uv:

# Set your GitHub token for PR creation
export GITHUB_TOKEN=your_github_token

# Run with uv
uv run python -m dependapy.main

To only check for updates without creating pull requests:

# If installed from PyPI
dependapy --no-pr

# Or run as a module
python -m dependapy.main --no-pr

# With uv
uv run python -m dependapy.main --no-pr

Command Line Options

usage: dependapy.main [-h] [--repo-path REPO_PATH] [--token TOKEN] [--no-pr]

Analyze and update Python dependencies

options:
  -h, --help           show this help message and exit
  --repo-path REPO_PATH
                       Path to the repository to scan (default: current directory)
  --token TOKEN        GitHub token (default: from GITHUB_TOKEN environment variable)
  --no-pr              Don't create or update pull requests, just show what would be updated

Setting Up as a GitHub Action

To automatically run dependapy weekly on your repository:

  1. Create a file at .github/workflows/dependapy.yml with the following content:
name: Dependapy

on:
  schedule:
    # Run every Sunday at 02:00 UTC
    - cron: '0 2 * * 0'
  workflow_dispatch:  # Allow manual triggering

jobs:
  update-dependencies:
    name: Update Dependencies
    runs-on: ubuntu-latest

    permissions:
      contents: write  # Needed to push code changes
      pull-requests: write  # Needed to create pull requests

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Fetch all history for git operations

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          
      - name: Install uv
        run: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          echo "$HOME/.cargo/bin" >> $GITHUB_PATH

      - name: Install dependencies
        run: |
          uv add dependapy

      - name: Run dependapy
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          python -m dependapy.main
  1. Configure the necessary permissions for GitHub Actions in your repository settings.

How It Works

  1. Repository Scanning: dependapy recursively finds all pyproject.toml files in your repository.
  2. Dependency Analysis:
    • Reads dependency information from the [project] section (following PEP 621)
    • Checks PyPI for latest available versions
    • Determines if Python version constraint is compatible with the newest Python versions
  3. Smart Updates: Only creates PRs when actual updates are needed
  4. PR Management: Creates a branch and PR, or updates an existing one if applicable

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dependapy-0.1.1.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dependapy-0.1.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file dependapy-0.1.1.tar.gz.

File metadata

  • Download URL: dependapy-0.1.1.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.4

File hashes

Hashes for dependapy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 22c2e9cf177c78fa437561d4e1adf2eed8d48068c6b001ae1d1144d6c02563d8
MD5 bd5862b85f35e8f57e164d2c697bdd9f
BLAKE2b-256 73543c1ef86c522d0a8d71a231371c7b054b88635957678c1ac1cd5708671a3d

See more details on using hashes here.

File details

Details for the file dependapy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dependapy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.4

File hashes

Hashes for dependapy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14d1b42f51b61cbfbe89055bf4b615dfc08c21143f15b943bd0d1aa305391cf9
MD5 fdf50e5bca33a643008f764b9f6dda43
BLAKE2b-256 204b29533a93ee2d71d79a77a361fb3a28513289a1f30a5ebf48baaba5217007

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page