Page MenuHomeSoftware Heritage

Add return type to get_storage.
AbandonedPublic

Authored by vlorentz on Jan 24 2020, 6:12 PM.

Details

Reviewers
ardumont
Group Reviewers
Reviewers
Summary

Depends on D2587, D2588.

Diff Detail

Repository
rDSTO Storage manager
Branch
rename-inmem
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10287
Build 15276: tox-on-jenkinsJenkins
Build 15275: arc lint + arc unit

Event Timeline

ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/storage/__init__.py
73

mmmph, ugly.
prefer the old version.

Also can't we raise a more explicit message as i remember we do in other part of the stack.

raise ValueError('Unsupported storage. Choices are...')

or something.

This revision now requires changes to proceed.Jan 28 2020, 2:13 PM
swh/storage/__init__.py
73

prefer the old version.

mypy says doesn't like the old version.

Also can't we raise a more explicit message as i remember we do in other part of the stack.

sure

woops, pushed to the wrong diff again (yes, I updated the counter on the whiteboard)

This revision is now accepted and ready to land.Jan 29 2020, 2:52 PM

Actually, that's a bad idea. It makes mypy refuse backend classes with missing endpoints (even deprecated ones)