Page MenuHomeSoftware Heritage

loader.package.deposit: Drop swh.deposit.client requirement
ClosedPublic

Authored by ardumont on Nov 20 2019, 7:04 PM.

Details

Summary

This unifies with the other package loader implementations. Also, this should
fix the current debian build failure [1] (which is the main goal here).

The real fix would be to rework properly the deposit packages/modules but i
don't feel like it's a tractable one for the current week.

[1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLDBASE/job/gbp-buildpackage/40/console

Test Plan

tox

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Nov 20 2019, 7:04 PM
ardumont added inline comments.Nov 20 2019, 7:13 PM
swh/loader/package/__init__.py
21

I thought that since we migrated to buster (python3.7), i could avoid this but mypy plainly refused it...

ardumont updated this revision to Diff 7969.Nov 21 2019, 10:57 AM

Update type annotation

ardumont added inline comments.Nov 21 2019, 10:57 AM
swh/loader/package/__init__.py
21

Sorry for the noise, it seems ok now.

ardumont updated this revision to Diff 7970.Nov 21 2019, 10:58 AM

Remove missed unused import

anlambert accepted this revision.Nov 21 2019, 11:13 AM
anlambert added subscribers: zack, anlambert.

Apart some nitpicking on type annotations, looks good to me !

swh/loader/package/deposit.py
63

Based on what @zack told us during its talk on mypy, concrete types should be used for annotated returned value and abstract ones for parameters. So List[Tuple[str, Dict]] should be used here.

168

missing type annotations here

196

s/Mapping/Dict/

209

missing type annotations

swh/loader/package/tests/conftest.py
17–18

s/Mapping/Dict/

This revision is now accepted and ready to land.Nov 21 2019, 11:13 AM
ardumont added inline comments.Nov 21 2019, 11:18 AM
swh/loader/package/deposit.py
63

Right, thx for reminding me!

ardumont updated this revision to Diff 7979.Nov 21 2019, 11:20 AM
  • Update missing type annotations
  • type: Declare specific type for returned values
ardumont updated this revision to Diff 7984.Nov 21 2019, 11:23 AM

Rebase on latest master