qtile icon indicating copy to clipboard operation
qtile copied to clipboard

Fix psutil current freq value is already in correct precision

Open asyncmind0 opened this issue 2 years ago • 6 comments

asyncmind0 avatar Apr 13 '22 11:04 asyncmind0

Was the widget showing the wrong data this whole time, or did psutil update something?

SweepingBishops avatar Apr 13 '22 13:04 SweepingBishops

There's a bug in psutil which they are fixing. As far as I'm aware, the fix has not been released. See #3180

This PR won't get accepted in its current form.

If you want a fix now, you'll need to test for the psutil version and if it's 5.9.0 then apply your fix, if not, there should be no change.

elParaguayo avatar Apr 13 '22 13:04 elParaguayo

The psutil fix is merged but not released. Looking at their tags, they release very infrequently, so maybe instead we can do a version check in the widget ourselves? This will likely be required anyway because it's very possible (likely) users will not have the most recent psutil installed. Qtile has no version bounds for psutil.

m-col avatar May 18 '22 13:05 m-col

Nice. Thanks for updating this.

You need to fix the test for this change too as we're only mocking psutil in the test environment (this is also why the docs don't build). Can you try changing these lines: https://github.com/qtile/qtile/blob/53bfe9235f4c67520d7f49ccbcb27312adfcd17e/test/widgets/test_cpu.py#L33-L36

to:

class MockPsutil(ModuleType):
    __version__ = "5.8.0"

    @classmethod
    def cpu_percent(cls):
        return 2.6

i.e. just inserting the __version__ value.

elParaguayo avatar May 31 '22 05:05 elParaguayo

The psutil fix is merged but not released. Looking at their tags, they release very infrequently, so maybe instead we can do a version check in the widget ourselves? This will likely be required anyway because it's very possible (likely) users will not have the most recent psutil installed. Qtile has no version bounds for psutil.

5.9.1 was released on 20 May so should hit Arch soon but other repos may still need this fix.

elParaguayo avatar May 31 '22 05:05 elParaguayo

@jagguli Can you do one of the following

  • rebase this onto the latest master and squash into a single commit; or
  • give me access to do this (tick "Allow edits and access to secrets by maintainers" in the PR)

elParaguayo avatar Jul 31 '22 12:07 elParaguayo

Closed in favour of #4059

elParaguayo avatar Dec 12 '22 19:12 elParaguayo