Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package_checks: output dep lists with proper offset #3928

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Staudey
Copy link
Member

@Staudey Staudey commented Sep 26, 2024

Summary

Change loader/dumper to ruamel to enable putting out dependency lists with proper offset and colon spacing. This way the output can directly be copied and pasted into the recipe.

Note: I couldn't find a way to do this with pyyaml; Dumper implementation adopted from ruamel docs. I also couldn't get top_level_colon_align to work for some reason, so in cases of very short subpackage names with dependencies the colon might be placed too far to the left (not 100% sure if there is such a case in the repo; the "^g++" case happens to perfectly align)

Resolves #3924

Test Plan

Old output budgie-desktop-branding:

- breeze-cursor-theme
- budgie-backgrounds
- budgie-desktop
- font-hack-ttf
- livecd:
  - budgie-desktop-branding
  - test
- materia-gtk-theme
- materia-gtk-theme-dark
- noto-sans-ttf
- noto-serif-ttf
- papirus-icon-theme
- qtstyleplugins
- solus-artwork
- test

New output budgie-desktop-branding:

    - breeze-cursor-theme
    - budgie-backgrounds
    - budgie-desktop
    - font-hack-ttf
    - livecd :
        - budgie-desktop-branding
        - test
    - materia-gtk-theme
    - materia-gtk-theme-dark
    - noto-sans-ttf
    - noto-serif-ttf
    - papirus-icon-theme
    - qtstyleplugins
    - solus-artwork
    - test

Old output gcc rundeps:

- ^g++: gcc
- ^gfortran:
  - gcc
  - libgfortran
- ^libgcc-32bit: libgcc
- ^libgfortran-32bit: libgfortran
- ^libgomp-32bit:
  - libgcc-32bit
  - libgomp
- ^libstdc++-32bit: libstdc++
- mpc
- mpfr
- test

New output gcc rundeps:

    - ^g++ : gcc
    - ^gfortran :
        - gcc
        - libgfortran
    - ^libgcc-32bit : libgcc
    - ^libgfortran-32bit : libgfortran
    - ^libgomp-32bit :
        - libgcc-32bit
        - libgomp
    - ^libstdc++-32bit : libstdc++
    - mpc
    - mpfr
    - test

Checklist

  • Package was built and tested against unstable

@Staudey
Copy link
Member Author

Staudey commented Sep 26, 2024

requirements: types-PyYAML

I guess this will need

requirements:
  - ruamel.yaml
  - types-PyYAML

or something to properly clear CI?

Locally I still get an error though

package_checks.py:470:33: error: Incompatible types in assignment (expression has type "str", variable has type "None")  [assignment]
Found 1 error in 1 file (checked 1 source file)

Not sure how I can resolve that

@silkeh
Copy link
Member

silkeh commented Sep 30, 2024

requirements: types-PyYAML

I guess this will need

requirements:
  - ruamel.yaml
  - types-PyYAML

or something to properly clear CI?

Maybe, if ruamel.yaml provides the correct type annotations to work.

The ruamel.yaml dependency should also be included in package_lint.yaml (no idea how though).

Locally I still get an error though

package_checks.py:470:33: error: Incompatible types in assignment (expression has type "str", variable has type "None")  [assignment]
Found 1 error in 1 file (checked 1 source file)

Not sure how I can resolve that

That's a type error, apparently you are assigning a string to a variable that is None. You can solve it by adding a type annotation or expressly ignoring the issue.

@Staudey Staudey force-pushed the dep-order-indent branch 9 times, most recently from 6ba1e98 to 9e7dbdd Compare October 1, 2024 22:05
**Summary**

Change loader/dumper to ruamel to enable putting out dependency lists with proper offset.
This way the output can directly be copied and pasted into the recipe.

Resolves getsolus#3924

Signed-off-by: Thomas Staudinger <[email protected]>
@Staudey
Copy link
Member Author

Staudey commented Oct 1, 2024

Okay, I fixed the lint errors. Not sure if everything is 100% above board though ^^

Going to take a look at the package_lint.yaml tomorrow

@Staudey Staudey force-pushed the dep-order-indent branch 2 times, most recently from b9516b6 to 52b860c Compare October 3, 2024 08:47
@Staudey
Copy link
Member Author

Staudey commented Oct 3, 2024

Okay, package lint worked with a test commit to nano. Seems like everything is in order now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

common/CI - Add 4 spaces before each dep in sort order check
2 participants