packages icon indicating copy to clipboard operation
packages copied to clipboard

Add sort_deps python script by Harvey and relevant go-task

Open Justinzobel opened this issue 1 year ago • 6 comments
trafficstars

Summary

Add sort_deps python script by Harvey and relevant go-task

Test Plan

Tested go-task sort on a package, deps sorted.

Justinzobel avatar Feb 18 '24 04:02 Justinzobel

Same as for the ypkg PR; looping in Silke and joey respectively (Silke for the linter py experience, Joey because he's doing the py3 upgrade and ypkg-py3 is on the horizon)

ermo avatar Feb 18 '24 04:02 ermo

checkdeps and rundeps as well

joebonrichie avatar Feb 18 '24 12:02 joebonrichie

rundeps will be more tricky, due to stuff like this:

Before:

rundeps    :
    - rocminfo
    - devel :
        - rocm-smi
        - llvm-clang-devel
        - rocm-compilersupport-devel
        - rocm-device-libs-devel
        - rocm-runtime-devel
        - rocminfo

After:

rundeps    :
    - devel :
        - rocm-smi
        - llvm-clang-devel
        - rocm-compilersupport-devel
        - rocm-device-libs-devel
        - rocm-runtime-devel
        - rocminfo
    - rocminfo

So it will not sort deps of sub packages at all, but it will sort sub packages and base package rundeps. If this is acceptable we can add it otherwise I am not sure how to deal with this scenario.

HarveyDevel avatar Feb 18 '24 12:02 HarveyDevel

I don't think this PR matches the logic in the CI (see here). The logic in the CI is basically as follows:

  1. Replace values in dictionary by sorted equivalents if item is a dictionary.
  2. Sort items with the following preference:
    1. pkgconfig32
    2. pkgconfig
    3. package name or dictionary key.

But it would probably be preferable to have a single bit of code defining this if possible.

silkeh avatar Feb 18 '24 19:02 silkeh

Why do we sort pkgconfig32() before pkgconfig()? Seems like it just complicates things without apparent benefit (because otherwise you could just sort all the pkgconfigs as a whole, and pkgconfig() would come first, instead of 32) [also I'd have to add that to the docs ^^]

Staudey avatar Feb 18 '24 20:02 Staudey

Why do we sort pkgconfig32() before pkgconfig()?

The CI script checks it this way because more packages have pkgconfig32 first, and the added complexity was negligible.

silkeh avatar Feb 18 '24 20:02 silkeh

@Justinzobel This is py2. Are you planning on working more on this?

ermo avatar Oct 25 '24 21:10 ermo

@Justinzobel This is py2. Are you planning on working more on this?

No. I've reached peak plate filling again and don't have the time or energy to continue this. If anyone wants to take it over please do, if not feel free to close.

Justinzobel avatar Oct 25 '24 23:10 Justinzobel