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

Show packages count divided by package manager #154

Merged

Conversation

cinghioGithub
Copy link
Contributor

Description

This PR changes the output provided by dividing the number of installed packages by package managers. It also adds support for flatpak and snap package count.

Reason and / or context

These changes allow to count flatpak and snap packages, also changing the total package count, moving from a total number to more precise data, showing the number of packages for each available package manager.

Example:

                                       User: username
                                       Hostname: hostname
                                       Model: machine_model
             ..vvAAAvv..               Distro: Ubuntu 22.04.4 LTS x86_64
        .:s/OOOOOOOOOOOOO\s:.          Kernel: Linux 6.8.0
      .sOOOOOOOOOOOOOO.vv.OOOs.        Uptime: 3 minutes
    .sOOOOOOOOO,ssssn:lMMl:OOOOs.      Load Average: 0.07 0.12 0.09
   :OOOOOOO.n@'MMMMMMy\^^/.OOOOOO:     Processes: 168
  :OOOOOOOiMMj@"OOOO"YIOOIlOOOOOOO:    Window Manager: Not detected
 .OOOOOO.MMMiOOOOOOOOOO`WMMM:OOOOOO.   Desktop Environment: GNOME
 iOO.vv.OJMWOOOOOOOOOOOOO:MMM:OOOOOi   Shell: /bin/bash
 OO:MMMM:lI:OOOOOOOOOOOOOii+iiOOOOOO   Terminal: xterm-256color ██ ██ ██ ██ ██ ██ ██
 iOO'YY'OJMMOOOOOOOOOOOOO:MMM:OOOOOi   Packages: (dpkg) 1432, (snap) 12
 'OOOOOO'MMMiOOOOOOOOOOO,MMMiOOOOOO'   Temperature: Not detected
  :OOOOOO'iMMY@,OOOOOO,;MMM/OOOOOO:    CPU: 13th Gen Intel(R) Core(TM) i9-13900H
   :OOOOOOO"Y@AMivviiY'__`'OOOOOO:     GPU: Red Hat, Inc. QXL paravirtual graphic card
    'QOOOOOOOO'"YYYYKOaMMM:OOOOP'      RAM: 1630 MiB / 3924 MiB
      'QOOOOOOOOOOOOOO`YY'OOOP'        Disk: 37.8 GiB / 88.0 GiB
        ':QOOOOOOOOOOOOOOOQ:'          LAN IP: 192.168.1.2
            '"":YOOOY:""'              WAN IP: Not detected

How has this been tested ?

It has been tested by updating the project's unittest suite.

Types of changes :

  • Bug fix (non-breaking change which fixes an issue)
  • Typo / style fix (non-breaking change which improves readability)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist :

  • I have updated the README.md file accordingly ;
  • I have updated the test cases (which pass) accordingly ;
  • This pull request targets next Archey version branch ;
  • My changes looks good ;
  • I agree that my code may be modified in the future ;
  • My code follows the code style of this project (PEP8).

@HorlogeSkynet HorlogeSkynet self-requested a review May 8, 2024 17:18
@HorlogeSkynet HorlogeSkynet self-assigned this May 8, 2024
@HorlogeSkynet HorlogeSkynet added the enhancement ⬆️ Implements a new feature, fixes or improves existing ones label May 8, 2024
@HorlogeSkynet HorlogeSkynet added this to the v4.14.4.0 milestone May 8, 2024
@HorlogeSkynet
Copy link
Owner

HorlogeSkynet commented May 9, 2024

Hello @cinghioGithub, and many thanks for your PR (it was actually a long-term idea to change back-end for this purpose).
Some notes :

  • I've cleaned up your branch a bit, mainly to simplify module, add some configuration, improve API and extends tests ;
  • I've added this PR to v4.15 milestone (this is API-breaking, so let's (partially) honor SemVer here) ;
  • (@ingrinder sorry, not sorry : another complex rebase here for [Output/Entry] Changes entries output method to pretty_value property #147 😕) ;
  • EDIT : I've added an option to enable previous behavior with total count.

Tell me what you think about this final implementation ! Bye 👋

@HorlogeSkynet
Copy link
Owner

Up @cinghioGithub ! 🙏

@cinghioGithub
Copy link
Contributor Author

Hi @HorlogeSkynet, sorry for the delay. I looked and everything seemed ok. I just don't know how much can be useful the show_zeros configuration option, but it is false by default so I like it. Thanks for fixing the style and adjusting the configuration as well.

@HorlogeSkynet
Copy link
Owner

I just don't know how much can be useful the show_zeros configuration option, but it is false by default so I like it.

I guess it could make sense to identify package manager back-ends that are not useful (no packages installed). Somehow, the option didn't cost much 🙃

Thanks for your feedback. Merging here.

@HorlogeSkynet HorlogeSkynet merged commit 5114c7c into HorlogeSkynet:master May 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ⬆️ Implements a new feature, fixes or improves existing ones
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants