Page MenuHomeSoftware Heritage

conda, rpm: Fix package versions sorting
ClosedPublic

Authored by anlambert on Dec 20 2022, 11:40 AM.

Details

Summary

Release 22.0 of packaging module can no longer parse invalid Python version
number, an exception is now raised.


RPM loader used the keys of the packages dict as version numbers to sort,
which are in the form "<distribution>/<edition>/<package_version_number>",
but those cannot be parsed anymore.

So use intrinsic version numbers of packages instead to sort the list of
versions.


Conda loader used the keys of the packages dict as version numbers to sort,
which are in the form "<arch>/<version>-<build>", but those cannot be parsed
anymore.

So extract intrinsic version numbers of packages instead to sort the list of
versions.

Also update snapshot release names to "<version>-<build>-<arch>" as each
release for a given architecture targets a different directory.

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Branch
conda-rpm-fix-versions-sorting
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 33320
Build 52225: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 52224: arc lint + arc unit

Event Timeline

Build has FAILED

Patch application report for D8974 (id=32328)

Rebasing onto e7ac7a3475...

Current branch diff-target is up to date.
Changes applied before test
commit b6231045473dbcff047126c22a6a43c9bc8cc769
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Dec 20 11:34:58 2022 +0100

    rpm: Fix package versions sorting
    
    Release 22.0 of packaging module can no longer parse invalid Python version
    number, an exception is now raised.
    
    RPM loader used the keys of the packages dict as version numbers to sort,
    which are in the form "<distribution>/<edition>/<package_version_number>",
    but those cannot be parsed anymore.
    
    So use intrinsic version numbers of packages instead to sort the list of
    versions.

Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/1035/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/1035/console

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 20 2022, 11:44 AM
Harbormaster failed remote builds in B33319: Diff 32328!

Add commit fixing the conda case in a similar maneer.

anlambert retitled this revision from rpm: Fix package versions sorting to conda, rpm: Fix package versions sorting.Dec 20 2022, 12:30 PM
anlambert edited the summary of this revision. (Show Details)
anlambert edited the summary of this revision. (Show Details)
anlambert edited the summary of this revision. (Show Details)

Build is green

Patch application report for D8974 (id=32329)

Rebasing onto e7ac7a3475...

Current branch diff-target is up to date.
Changes applied before test
commit a63b39e5056fe39bf2b903bd66b9873d13c400db
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Dec 20 12:24:41 2022 +0100

    conda: Fix versions sorting and update release names
    
    Release 22.0 of packaging module can no longer parse invalid Python version
    number, an exception is now raised.
    
    Conda loader used the keys of the packages dict as version numbers to sort,
    which are in the form "<arch>/<version>-<build>", but those cannot be parsed
    anymore.
    
    So extract intrinsic version numbers of packages instead to sort the list of
    versions.
    
    Also update snapshot release names to "<version>-<build>-<arch>" as each
    release for a given architecture targets a different directory.

commit b6231045473dbcff047126c22a6a43c9bc8cc769
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Dec 20 11:34:58 2022 +0100

    rpm: Fix package versions sorting
    
    Release 22.0 of packaging module can no longer parse invalid Python version
    number, an exception is now raised.
    
    RPM loader used the keys of the packages dict as version numbers to sort,
    which are in the form "<distribution>/<edition>/<package_version_number>",
    but those cannot be parsed anymore.
    
    So use intrinsic version numbers of packages instead to sort the list of
    versions.

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

This revision is now accepted and ready to land.Dec 20 2022, 12:51 PM