Page MenuHomeSoftware Heritage

Replace Dict[str, bytes] with a TypedDict to represent dicts of hashes
Needs ReviewPublic

Authored by vlorentz on Mon, Jul 18, 1:53 PM.

Details

Summary

Unfortunately, this requires jumping through a few hoops (cast() and
# type: ignore) as mypy does not allow d[k] when d is a typed dict
and k is not a literal string.

Diff Detail

Repository
rDSTO Storage manager
Branch
objid
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 30435
Build 47577: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 47576: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D8126 (id=29358)

Rebasing onto fbe3803820...

Current branch diff-target is up to date.
Changes applied before test
commit 21b16053f3098f41f58f5a49c9ea68b4140cdb64
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Jul 18 13:51:44 2022 +0200

    Replace Dict[str, bytes] with a TypedDict to represent dicts of hashes
    
    Unfortunately, this requires jumping through a few hoops (`cast()` and
    `# type: ignore`) as mypy does not allow `d[k]` when `d` is a typed dict
    and `k` is not a literal string.

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/1635/ for more details.