Skip to content

Add site-packages watchers#1597

Open
edvilme wants to merge 6 commits into
mainfrom
packages-sync
Open

Add site-packages watchers#1597
edvilme wants to merge 6 commits into
mainfrom
packages-sync

Conversation

@edvilme

@edvilme edvilme commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
package.sync.mp4

This pull request refactors and centralizes the logic for watching Python package changes across different environment managers (system, conda, poetry). The new approach introduces a shared utility to handle file system watching for package metadata, ensuring more robust and consistent package refresh behavior when environments change.

Key improvements and changes:

Centralized Package Watcher Logic:

  • Added a new module, packageWatcher.ts, which provides watchPackageChangesForEnvironment and registerPackageWatcherForManager to handle file watching and package refresh for any environment manager. This replaces duplicated logic in each manager.

Refactoring of Environment Managers:

  • Updated main.ts files for system, conda, and poetry managers to use the new registerPackageWatcherForManager function, removing their own package watcher and debounce logic. This simplifies each manager and ensures consistency. [1] [2] [3] [4] [5] [6]

Improved Robustness and Maintainability:

  • The new watcher logic automatically tracks the active environment, ensuring watchers are always up-to-date and resources are cleaned up appropriately.

Platform and Environment Awareness:

  • The watcher targets are now tailored to different platforms (Windows, Unix) and environment types (including conda), ensuring accurate detection of package changes.

@edvilme edvilme added the feature-request Request for new features or functionality label Jun 18, 2026
@edvilme edvilme linked an issue Jun 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically refresh package list on package changes

1 participant