feat: implement python dependency lifecycle and reference counting#1025
Open
AshokThangavel wants to merge 1 commit intointersystems:mainfrom
Open
feat: implement python dependency lifecycle and reference counting#1025AshokThangavel wants to merge 1 commit intointersystems:mainfrom
AshokThangavel wants to merge 1 commit intointersystems:mainfrom
Conversation
- Added %IPM.Storage.PythonReference to track library metadata (SourceType, Version, WheelPath). - Added '-with-py' modifier to the 'uninstall' command to allow conditional physical removal via pip. - Created %IPM.Utils.Python for centralized environment gating and version retrieval.
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.
Overview
This PR introduces a robust Python library management system for the IPM (InterSystems Package Manager). It transitions the system to a state-aware lifecycle manager that tracks library ownership, handles local wheel files, and ensures a clean environment during module uninstallation.
fixed: #1006
Key Implementations
-with-pyModifier: New opt-in flag foruninstall. By default, Python libraries are preserved. Physical removal only occurs when-with-pyis explicitly called.%IPM.Storage.PythonReferenceto track library usage across the instance.RefCount- Prevents "Dependency Breaking": A library is only physically uninstalled when itsRefCountreaches 0, meaning no other installed module requires it.pip uninstalltriggers only whenRefCountreaches 1 (the final module using it).Execution Sample (Verbose Mode)
Additionally fixed the
<UNDEFINED>InstallOrDownloadPythonRequirem+64^%IPM.Lifecycle.Base.1errorto