Fix/selective install#52
Merged
Merged
Conversation
- Added only_packages filter to _install_apm_dependencies() - Uses endswith() matching to handle host prefix differences - Uses builtins.list/set to avoid Click command shadowing - apm install (no args) still installs all from apm.yml
Tests cover the filter matching logic that ensures: - apm install <package> only installs that specific package - Filter correctly handles host prefix mismatch (github.com/owner/repo vs owner/repo) - Virtual packages with subdirectory paths match correctly - Non-matching packages are correctly excluded The test_real_bug_case_mcp_builder_vs_design_guidelines test directly covers the bug where installing mcp-builder also installed design-guidelines.
apm install <package> now only installs the specified package. apm install (no args) continues to install all from apm.yml. - Added only_packages filter to _install_apm_dependencies() - Uses endswith() matching to handle host prefix differences - Added unit tests for filter matching logic - Bumped version to 0.6.3
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a critical bug where apm install <package> was incorrectly installing all packages from apm.yml instead of only the specified package(s). The fix introduces selective installation by passing the requested packages as a filter to the _install_apm_dependencies function.
Key Changes:
- Added
only_packagesparameter to_install_apm_dependencies()to enable selective filtering - Implemented filtering logic to match user-specified packages against resolved dependencies
- Added comprehensive unit tests for the filter matching logic covering various edge cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/apm_cli/cli.py | Added only_pkgs parameter passing and filtering logic in _install_apm_dependencies() to install only specified packages; fixed return values to always return tuple |
| tests/unit/test_selective_install.py | New test suite with 12 test cases covering filter matching logic including host prefixes, virtual packages, Azure DevOps, and edge cases |
| pyproject.toml | Version bump from 0.6.2 to 0.6.3 |
| CHANGELOG.md | Added entry documenting the selective install fix |
Code review fixes:
- Fixed substring owner bug: 'prefix-owner/repo' no longer matches 'owner/repo'
- Changed endswith(pkg) to endswith(f'/{pkg}') for path boundary matching
- Added test for substring owner names
- Removed unused pytest import
- Updated docs/cli-reference.md to clarify selective install behavior
CI fix:
- Added _git/ normalization for ADO URLs in filter matching
- User passes: dev.azure.com/org/proj/_git/repo
- Dep string is: dev.azure.com/org/proj/repo (normalized)
- Filter now normalizes _git/ before comparing
- Added test for ADO _git/ normalization
sergio-sisternes-epam
pushed a commit
that referenced
this pull request
May 19, 2026
Fix/selective install
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.
This pull request fixes a bug where running
apm install <package>would incorrectly install all packages fromapm.ymlinstead of just the specified package. Now,apm install <package>only installs the requested package(s), whileapm installwithout arguments continues to install all packages. The update also includes new tests to ensure the selective installation logic works as intended.