Skip to content

typing: annotate manifest module boundaries and enable strict mypy checks (refs #10021) - #10556

Open
Prateek99-s wants to merge 1 commit into
borgbackup:masterfrom
Prateek99-s:typing-manifest
Open

Prateek99-s wants to merge 1 commit into
borgbackup:masterfrom
Prateek99-s:typing-manifest

Conversation

@Prateek99-s

Copy link
Copy Markdown

Addresses part of #10021.

Summary of Changes

As proposed in #10021 (gradual typing for Borg 2.0 module boundaries), this PR:

  1. Annotates src/borg/manifest.py:
    • Added full type hints to ArchiveInfo, ArchivesInterface, Archives, and Manifest.
    • Annotated archive grouping and date-filtering helpers.
  2. Harmonizes LegacyArchives Protocol compliance:
    • Added *, reverse=False to LegacyArchives.list_considering to match Archives.list_considering and fulfill ArchivesInterface.
  3. Configures pyproject.toml:
    • Added missing library stub overrides for untyped dependencies (borghash.*, borgstore.*, textual.*, mfusepy).
    • Enabled strict mypy checking for borg.manifest (disallow_untyped_defs = true, disallow_incomplete_defs = true, check_untyped_defs = true).

Verification

  • mypy src/borg/manifest.py: Success (no issues found).
  • Global mypy: Success (no issues found in 232 source files).
  • pytest src/borg/testsuite/archive_test.py src/borg/testsuite/archives_test.py src/borg/testsuite/legacy_archives_test.py: 213 passed.
  • Pre-commit (black + ruff): Passed cleanly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant