Skip to content

Fix plugins.txt name matching for git URLs and local paths#481

Merged
yondonfu merged 1 commit intomainfrom
fix/plugin-name-matching
Feb 18, 2026
Merged

Fix plugins.txt name matching for git URLs and local paths#481
yondonfu merged 1 commit intomainfrom
fix/plugin-name-matching

Conversation

@yondonfu
Copy link
Copy Markdown
Contributor

@yondonfu yondonfu commented Feb 18, 2026

Summary

  • Constrain plugin dependency versions from uv.lock: Add _generate_constraints that reads uv.lock to produce floor+ceiling constraints (e.g. transformers>=4.57.5,<5) for the host project's direct dependencies. _compile_plugins now passes these constraints to uv pip compile, preventing plugins from pulling in incompatible major version bumps.
  • Always recompile on startup: ensure_plugins_installed now always recompiles against current lock constraints instead of reusing a potentially stale resolved.txt, falling back to the existing resolved.txt only if compilation fails.
  • Fix git URL name matching: _extract_package_name now looks up the authoritative package name from resolved.txt via a new _get_name_from_resolved helper (e.g. git+https://…/FlashVSR-Proflashvsr), falling back to the repo name when resolved.txt is unavailable.
  • Fix local path name matching: _extract_package_name now delegates to the existing _get_package_name_from_path helper for directory paths, reading pyproject.toml for 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 handling
  • TestCompilePluginsConstraints — 2 tests verifying --constraint flag is passed/omitted correctly
  • TestEnsurePluginsInstalledRecompile — 3 tests covering recompile behavior and fallback
  • TestGetNameFromResolved — 4 tests covering successful lookup, .git suffix mismatch, missing resolved.txt, and URL not found
  • TestExtractPackageName — 5 tests covering git URL with resolved lookup, git URL fallback, local path with pyproject.toml, local path without pyproject.toml, and PyPI specs
  • All 99 tests pass (uv run pytest tests/test_plugin_manager.py -v)
  • Import check passes (from scope.core.plugins.manager import PluginManager)

🤖 Generated with Claude Code

_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]>
@yondonfu yondonfu merged commit 3c6242d into main Feb 18, 2026
6 checks passed
@yondonfu yondonfu deleted the fix/plugin-name-matching branch February 18, 2026 01:10
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.

1 participant