[FIX] 5.3: Update Checker — compare installed vs latest package versions #261

Open
Rockachopa wants to merge 1 commits from step35/109-5-3-update-checker into main
Owner

What

Adds update_checker.py — dependency health monitoring tool that checks
installed Python packages against PyPI latest versions, classifies updates
by semver impact, flags breaking changes, and produces actionable reports.

Why

Dependency staleness is a security and stability risk. Knowing which
packages are out of date, and how severe the updates are, enables
informed maintenance decisions.

Severity What changed
HIGH (major) Breaking changes — requires code review
MEDIUM (minor) New features, should upgrade
LOW (patch) Bug/security fixes, safe to apply

How

CLI Usage

# Check all installed packages
python3 scripts/update_checker.py

# JSON output for tooling
python3 scripts/update_checker.py --json

# Write report to file
python3 scripts/update_checker.py --output updates.md

# Check specific package
python3 scripts/update_checker.py --package requests,pytest

Output format (text)

============================================================
DEPENDENCY UPDATE REPORT
Generated: 2026-04-26 HH:MM:SS
============================================================

Found 2 package(s) with available updates:

  pytest:
    Installed: 8.0.0
    Latest:    9.0.3
    Update:    MAJOR ⚠ BREAKING CHANGE
    Severity:  HIGH

  requests:
    Installed: 2.28.0
    Latest:    2.33.1
    Update:    MINOR
    Severity:  MEDIUM

JSON schema

{
  "generated_at": "2026-04-26T09:21:08.000000",
  "total_updates": 2,
  "updates": [
    {
      "package": "pytest",
      "installed": "8.0.0",
      "latest": "9.0.3",
      "update_type": "major",
      "breaking_change": true,
      "severity": "high"
    }
  ],
  "summary": {
    "major": 1,
    "minor": 1,
    "patch": 0,
    "breaking": 1
  }
}

Implementation details

  • Installed packages: pip list --format=json
  • Latest versions: PyPI JSON API (https://pypi.org/pypi/{pkg}/json)
  • Version parsing: semantic version tuple extraction (major/minor/patch)
  • Classification: major=breaking/high, minor=feature/medium, patch=bugfix/low

Acceptance criteria

  • Compares installed vs latest — pip list → PyPI API
  • Reports major/minor/patch updates — classified by semver delta
  • Flags breaking changes (major)breaking_change: true on major
  • Output: update report — text and JSON formats

Testing

11 tests, all passing:

python3 scripts/test_update_checker.py
# or
python3 -m pytest tests/test_update_checker.py scripts/test_update_checker.py -v

Refs: #109
Closes #109

## What Adds `update_checker.py` — dependency health monitoring tool that checks installed Python packages against PyPI latest versions, classifies updates by semver impact, flags breaking changes, and produces actionable reports. ## Why Dependency staleness is a security and stability risk. Knowing which packages are out of date, and how severe the updates are, enables informed maintenance decisions. | Severity | What changed | |----------|-------------| | **HIGH (major)** | Breaking changes — requires code review | | **MEDIUM (minor)** | New features, should upgrade | | **LOW (patch)** | Bug/security fixes, safe to apply | ## How ### CLI Usage ```bash # Check all installed packages python3 scripts/update_checker.py # JSON output for tooling python3 scripts/update_checker.py --json # Write report to file python3 scripts/update_checker.py --output updates.md # Check specific package python3 scripts/update_checker.py --package requests,pytest ``` ### Output format (text) ``` ============================================================ DEPENDENCY UPDATE REPORT Generated: 2026-04-26 HH:MM:SS ============================================================ Found 2 package(s) with available updates: pytest: Installed: 8.0.0 Latest: 9.0.3 Update: MAJOR ⚠ BREAKING CHANGE Severity: HIGH requests: Installed: 2.28.0 Latest: 2.33.1 Update: MINOR Severity: MEDIUM ``` ### JSON schema ```json { "generated_at": "2026-04-26T09:21:08.000000", "total_updates": 2, "updates": [ { "package": "pytest", "installed": "8.0.0", "latest": "9.0.3", "update_type": "major", "breaking_change": true, "severity": "high" } ], "summary": { "major": 1, "minor": 1, "patch": 0, "breaking": 1 } } ``` ### Implementation details - **Installed packages**: `pip list --format=json` - **Latest versions**: PyPI JSON API (`https://pypi.org/pypi/{pkg}/json`) - **Version parsing**: semantic version tuple extraction (major/minor/patch) - **Classification**: major=breaking/high, minor=feature/medium, patch=bugfix/low ### Acceptance criteria - ✅ **Compares installed vs latest** — pip list → PyPI API - ✅ **Reports major/minor/patch updates** — classified by semver delta - ✅ **Flags breaking changes (major)** — `breaking_change: true` on major - ✅ **Output: update report** — text and JSON formats ## Testing 11 tests, all passing: ```bash python3 scripts/test_update_checker.py # or python3 -m pytest tests/test_update_checker.py scripts/test_update_checker.py -v ``` Refs: #109 Closes #109
Rockachopa added 1 commit 2026-04-26 13:24:02 +00:00
feat(5.3): Add Update Checker — compare installed vs latest versions
Some checks failed
Test / pytest (pull_request) Failing after 8s
80f82c9ecd
Add scripts/update_checker.py — dependency health monitor that checks
installed Python packages against PyPI latest, classifies updates by
semver (major/minor/patch), flags breaking changes, and outputs a
human-readable or JSON report.

Acceptance criteria:
  ✓ Compares installed vs latest via pip list + PyPI JSON API
  ✓ Reports major/minor/patch updates with severity (high/medium/low)
  ✓ Flags breaking changes (major version jumps)
  ✓ Output: formatted text report or --json machine report

Also adds comprehensive test suite (11 tests, all passing).

Refs: #109
Owner

🛡️ Goblin Patrol Alert 🛡️

Hey brother — this PR has been idle for 6 days and is unassigned.

The goblin fleet has been notified. A goblin may claim this if it remains stale.

— Timmy Goblin Wizard King

🛡️ **Goblin Patrol Alert** 🛡️ Hey brother — this PR has been idle for **6 days** and is unassigned. The goblin fleet has been notified. A goblin may claim this if it remains stale. — Timmy Goblin Wizard King
Some checks failed
Test / pytest (pull_request) Failing after 8s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin step35/109-5-3-update-checker:step35/109-5-3-update-checker
git checkout step35/109-5-3-update-checker
Sign in to join this conversation.