Repository navigation
fix: preserve plugin dependency extras during precheck - #10656
Draft
Plastic-time wants to merge 1 commit into
Draft
Plastic-time wants to merge 1 commit into
Plastic-time wants to merge 1 commit into
Conversation
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.
Plugin requirements such as
demo[feature]>=1.0can be skipped when only the basedemodistribution is installed. The precheck drops extras while reducing requirements to names and versions, so the plugin loader reports that dependencies are satisfied even when the extra's dependencies are missing.Modifications
Return the existing indeterminate precheck result for active requirements with extras, allowing pip to resolve and verify their transitive dependencies.
Keep the fast path for ordinary requirements and skip extras whose environment marker is false.
Add regression coverage at the classifier, install-plan, and plugin-install boundaries. No new dependencies or WebUI/API changes.
This is NOT a breaking change.
Verification Steps and Test Results
On base
f2404c191716a64daaa422be7f3c567cace50d39, the new tests produce 4 failures and 1 pass: the plugin installer is never called for an installed base package with requested extras. After the fix:python -m pytest tests/test_pip_helper_modules.py tests/test_pip_installer.py tests/test_plugin_manager.py -q: 244 passed.ruff format --check .: 519 files already formatted.ruff check .: all checks passed.Also verified the actual
_install_requirements_with_precheck→PipInstaller→ pip path offline on Windows x64 / Python 3.12.15. Two local wheels were used:astrbot-extras-probedeclares afeatureextra requiringastrbot-extras-leaf; only the base wheel was initially installed. With--no-index --find-linkspointed at those wheels:No live package index was used for this reproduction. The complete repository test suite and Linux/macOS runs were not executed locally. Existing audioop/jieba warnings remain. Prepared with AI assistance.
Checklist
Summary by Sourcery
Ensure plugin dependency prechecks defer active requirements with extras to pip so their transitive dependencies are correctly verified and installed.
Bug Fixes:
Enhancements:
Tests: