Fix plugins.txt name matching for git URLs and local paths#481
Merged
Conversation
_extract_package_name returned the repo name for git URLs (e.g.
"FlashVSR-Pro") instead of the actual package name ("flashvsr"), and
returned the full filesystem path for local directories. This caused
ensure_plugins_installed to think plugins were missing on every restart,
triggering unnecessary reinstalls.
Add _get_name_from_resolved to look up the authoritative package name
from resolved.txt for git URLs. Update _extract_package_name to use it
for git URLs and delegate to _get_package_name_from_path for local
directory paths.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Yondon Fu <[email protected]>
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
_generate_constraintsthat readsuv.lockto produce floor+ceiling constraints (e.g.transformers>=4.57.5,<5) for the host project's direct dependencies._compile_pluginsnow passes these constraints touv pip compile, preventing plugins from pulling in incompatible major version bumps.ensure_plugins_installednow always recompiles against current lock constraints instead of reusing a potentially staleresolved.txt, falling back to the existing resolved.txt only if compilation fails._extract_package_namenow looks up the authoritative package name fromresolved.txtvia a new_get_name_from_resolvedhelper (e.g.git+https://…/FlashVSR-Pro→flashvsr), falling back to the repo name when resolved.txt is unavailable._extract_package_namenow delegates to the existing_get_package_name_from_pathhelper for directory paths, readingpyproject.tomlfor the real package name instead of returning the full path.Test plan
TestGenerateConstraints— 7 tests covering lock parsing, direct-only deps, deduplication, local version skipping, marker deps, and error handlingTestCompilePluginsConstraints— 2 tests verifying--constraintflag is passed/omitted correctlyTestEnsurePluginsInstalledRecompile— 3 tests covering recompile behavior and fallbackTestGetNameFromResolved— 4 tests covering successful lookup,.gitsuffix mismatch, missing resolved.txt, and URL not foundTestExtractPackageName— 5 tests covering git URL with resolved lookup, git URL fallback, local path with pyproject.toml, local path without pyproject.toml, and PyPI specsuv run pytest tests/test_plugin_manager.py -v)from scope.core.plugins.manager import PluginManager)🤖 Generated with Claude Code