Page MenuHomeSoftware Heritage

Pubdev: Ensure we correctly parse and sort release versions
ClosedPublic

Authored by franckbret on Sep 13 2022, 10:04 AM.

Details

Summary

Make use of packaging.versions instead of distutils versions classes
that are deprecated

Resolves T4528

Related to T4465

Diff Detail

Event Timeline

Build is green

Patch application report for D8455 (id=30474)

Rebasing onto 4a2fe2f861...

Current branch diff-target is up to date.
Changes applied before test
commit 6c97ec689e6b042d8a0a2285299a96ee679f1478
Author: Franck Bret <franck.bret@octobus.net>
Date:   Tue Sep 13 09:58:36 2022 +0200

    Pubdev: Ensure we correctly parse and sort release versions
    
    Make use of packaging.versions instead of distutils versions classes
    that are deprecated
    
    Related T4528, T4465

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

anlambert added a subscriber: anlambert.

Thanks, before I can accept this, one inline comment to handle and the packaging dependency needs to be added in the requirements.txt file.

swh/loader/package/pubdev/loader.py
103–107

You can still use previous code here and replace the sort key by parse_version.

This revision now requires changes to proceed.Sep 13 2022, 11:08 AM
vlorentz added tasks: Restricted Maniphest Task, T4465: Ingest pub.dev (Dart, Flutter).

please don't undo the pretty-printing of data files.

Also, remove the large echos from fake_pubdev.sh, that only needs to build tarballs, not the other JSON files that simulate the API

Add packaging to requirements + some cleanup

Simplier usage of parse_version
Add 'packaging' to requirements
Prettify json test data files and stop generating those files through fake_pudev.sh

Build is green

Patch application report for D8455 (id=30508)

Rebasing onto 4a2fe2f861...

Current branch diff-target is up to date.
Changes applied before test
commit 134087342b421eeb66a37ad7d8d9750a9750cc96
Author: Franck Bret <franck.bret@octobus.net>
Date:   Tue Sep 13 09:58:36 2022 +0200

    Pubdev: Ensure we correctly parse and sort release versions
    
    Make use of packaging.versions instead of distutils versions classes
    that are deprecated
    
    Resolves T4528
    Related T4465

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

Looks good to me, thanks !

This revision is now accepted and ready to land.Sep 13 2022, 5:13 PM