Skip to content

Improve type precision in libregrtest excepthook, export clinic.cpp module in __all__, enhance Dependabot update frequency and rebasing, and fix test_compute_changes logic #37

@George-Codr

Description

@George-Codr

Title: Improve type precision in libregrtest excepthook, export clinic.cpp module in all, enhance Dependabot update frequency and rebasing, and fix test_compute_changes logic

Problem / Motivation

Several developer-experience and maintenance issues exist in the current fork:

  1. The type annotation for the optional excepthook argument in Lib/test/libregrtest/utils.py uses Any | None, which defeats most benefits of static type checking in that area.
  2. The cpp module inside Tools/clinic/libclinic is imported and used internally but is not present in __all__, so it is not formally exported and may confuse type checkers or linters that respect __all__.
  3. Dependabot is currently configured for monthly updates with no automatic rebasing strategy, which leads to delayed dependency updates and frequent manual conflict resolution during CI.
  4. A small logic bug exists in the test suite file Lib/test/test_tools/test_compute_changes.py that can produce incorrect test outcomes under certain conditions.
  5. Fork-specific files (CODEOWNERS, selected GitHub Actions workflows) contain minor outdated or redundant entries.

Proposed Improvements

  • Replace the loose type Any | None with the exact signature Callable[[threading.ExceptHookArgs], None] | None for the excepthook parameter in libregrtest/utils.py.
  • Explicitly add "cpp" to __all__ in Tools/clinic/libclinic/__init__.py (and ensure the import remains).
  • Update .github/dependabot.yml:
    • Change schedule.interval from monthly → weekly
    • Add rebase-strategy: auto to reduce merge conflicts
  • Apply small clean-ups to fork-specific:
    • .github/CODEOWNERS
    • Three workflow files under .github/workflows/
  • Correct the conditional logic bug present in Lib/test/test_tools/test_compute_changes.py.

Scope & Impact

  • All changes are strictly limited to:
    • Test suite infrastructure
    • Argument Clinic tooling
    • Static type annotations
    • Dependency update automation (Dependabot)
    • Fork-specific CI configuration
  • No changes are made to:
    • Interpreter core
    • Standard library public API
    • Any compiled extension module
    • Any runtime behaviour

Checklist

  • All tests pass on the three main GitHub-hosted runners (ubuntu-latest, windows-latest, macos-latest)
  • mypy, pyright and pytype type checkers report no new errors
  • Sourcery and CodeRabbit automated reviews applied and resolved
  • Docstring coverage warning is acknowledged (planned separate improvement)

Additional context

This set of changes was developed and reviewed in PR #36 (zrsx/cpython).
All modifications aim to bring developer tooling closer to upstream CPython quality standards while keeping the fork maintainable.

Thanks in advance for any feedback or review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions