Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
rusty3699
force-pushed
the
fix/psutil-8-typeshed-stubs
branch
from
November 13, 2026 14:15
b838edb to
d1bcca7
Compare
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: core (https://github.com/home-assistant/core)
+ homeassistant/components/systemmonitor/sensor.py:15: error: Module "psutil._common" has no attribute "POWER_TIME_UNKNOWN" [attr-defined]
+ homeassistant/components/systemmonitor/sensor.py:15: error: Module "psutil._common" has no attribute "POWER_TIME_UNLIMITED" [attr-defined]
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the psutil stubs for the 8.0 development version and consolidates the per-platform
_psutil_*stubs into a unified_psutil.pyi.Notes
types-psutilstubs for 8.0 giampaolo/psutil#3114.METADATA.tomlmust remain at 7.2.2 until 8.0 is released. This branch currently contains a temporary 8.0.0 bump that will need to be reverted before merge.mypy_primer
The
mypy_primercheck passed and reported two new Home Assistant diagnostics:psutil._commonhas no attributePOWER_TIME_UNKNOWN/POWER_TIME_UNLIMITED. At the targeted psutil commit86ce17c,psutil._commonno longer exposes these constants — they are members of theBatteryTimeenum inpsutil._enums, following upstream commit34a9e324. The stubs intentionally match the 8.0 runtime here; no stub change is needed.Stubtest blocker
The third-party stubtest CI jobs (Linux, Windows, macOS) fail only because
psutil==8.0.0is not yet installable from PyPI — pip cannot resolve the pinned version. These checks are expected to pass once 8.0.0 is released; no code change is required for them.Validation
tests/runtests.py stubs/psutilpassed for Python 3.10–3.15.mypy.stubtestpassed against locally installed psutil 8.0.0.