Page MenuHomeSoftware Heritage

WIP: Aur: Implements basic loader
Needs RevisionPublic

Authored by franckbret on Wed, Aug 3, 4:27 PM.

Details

Reviewers
vlorentz
Group Reviewers
Reviewers
Summary

Add 'aur' package loader

Diff Detail

Event Timeline

Build is green

Patch application report for D8174 (id=29524)

Rebasing onto 0913e11f69...

First, rewinding head to replay your work on top of it...
Applying: WIP: Aur: Implements basic loader
Changes applied before test
commit 53019e6cc463dded390936ff95d67b6a3ff4e84e
Author: Franck Bret <franck.bret@octobus.net>
Date:   Wed Aug 3 16:16:02 2022 +0200

    WIP: Aur: Implements basic loader
    
    Add 'aur' package loader

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

vlorentz requested changes to this revision.Wed, Aug 3, 6:24 PM
vlorentz added a subscriber: vlorentz.

Looks good overall.

can pkgdesc contain multiple lines? If yes, please add a test

swh/loader/package/aur/loader.py
47–49

can open as text if we always decode it anyway

48

according to https://wiki.archlinux.org/title/.SRCINFO , this isn't always true

52–60

this is more pythonic

unrelatedly, wouldn't it be simpler to make data of type Dict[str, List[str]], so the type check can be skipped? It would replace this:

if k in data:
    if type(data[k]) is not list:
        data[k] = [data[k]]
    data[k].append(v)
else:
    data[k] = v

with this:

data.setdefault(k, []).append(v)

and make the output format simpler by having consistent value types.

91
swh/loader/package/aur/tests/test_aur.py
177–181

What exception should this capture? It looks like loader.load() so neither assertion actually runs

This revision now requires changes to proceed.Wed, Aug 3, 6:24 PM