Page MenuHomeSoftware Heritage

package/pypi: Handle missing Version field in PKG-INFO file
ClosedPublic

Authored by anlambert on Sep 13 2021, 3:22 PM.

Details

Summary

Some PKG-INFO files are malformed or are missing the Version field
which causes error when trying to build the revision associated to
a package version.

So handle that edge case to fix loading issues.

Related sentry issue

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

Build is green

Patch application report for D6245 (id=22607)

Rebasing onto 8e00be225c...

Current branch diff-target is up to date.
Changes applied before test
commit d83dee9f9485ff665eb7e611155292218ce07706
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Sep 13 15:18:00 2021 +0200

    package/pypi: Handle missing Version field in PKG-INFO file
    
    Some PKG-INFO files are malformed or are missing the Version field
    which causes error when trying to build the revision associated to
    a package version.
    
    So handle that edge case to fix loading issues.

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/loader/package/pypi/tests/test_pypi.py
849
This revision is now accepted and ready to land.Sep 13 2021, 3:57 PM

Build is green

Patch application report for D6245 (id=22624)

Rebasing onto 8e00be225c...

Current branch diff-target is up to date.
Changes applied before test
commit 0efaf7a0ef96e1807c86e0b01a20a3514c838032
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Sep 13 15:18:00 2021 +0200

    package/pypi: Handle missing Version field in PKG-INFO file
    
    Some PKG-INFO files are malformed or are missing the Version field
    which causes error when trying to build the revision associated to
    a package version.
    
    So handle that edge case to fix loading issues.

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