Skip to content

fix(prerequisites): return explicit booleans from Prerequisite.is_valid - #3422

Open
SHANNWD wants to merge 1 commit into
kivy:developfrom
SHANNWD:fix/prerequisite-is-valid-return
Open

SHANNWD wants to merge 1 commit into
kivy:developfrom
SHANNWD:fix/prerequisite-is-valid-return

Conversation

@SHANNWD

@SHANNWD SHANNWD commented Dec 1, 2026

Copy link
Copy Markdown

Summary

Fixes Prerequisite.is_valid() return values in pythonforandroid/prerequisites.py:

  • Returns True instead of (True, "") when the prerequisite check passes.
  • Returns True (after logging a warning) when a non-mandatory prerequisite is not met, so check_and_install_default_prerequisites() does not treat it as falsy and attempt installation.
  • Explicitly returns False (after logging an error) when a mandatory prerequisite is not met, instead of implicitly returning None.
  • Updates TestPrerequisiteBaseClass unit tests in tests/test_prerequisites.py to assert the explicit boolean return values.

Fixes #2865

Verification

  • Ran pytest tests/test_prerequisites.py (all TestPrerequisiteBaseClass and TestCheckAndInstallPrerequisites tests pass).

Disclosure: AI assistance was used to draft and verify these changes; all diffs and checks were reviewed before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prerequisite.is_valid has unexpected return values.

1 participant