-
Notifications
You must be signed in to change notification settings - Fork 1
Caching settings, editable install support, and better validation #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a caching mechanism for settings to improve load time, switches the dynamic choices API to a public method, and aligns test scaffolding and configuration with the new behavior.
- Add persistent user settings cache with invalidation based on entry-points hash
- Rename _get_dynamic_choices to get_dynamic_choices and update call sites/tests
- Adjust test fixtures to disable persistence during tests; update dependency groups in tooling configs
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ndev_settings/_settings.py | Major refactor to add a persistent cache under XDG_CONFIG_HOME, entry-point hash invalidation, public get_dynamic_choices, and group sync/save logic. |
| src/ndev_settings/_settings_widget.py | Updates widget to use the new public get_dynamic_choices API. |
| tests/test_settings.py | Updates tests to reflect save-sync behavior and first-wins external merge semantics; switches to public get_dynamic_choices; adds deterministic expectations for external conflicts. |
| tests/conftest.py | Adds autouse fixtures to disable persistence and to redirect default settings file path for tests; resets singleton between tests. |
| src/ndev_settings/init.py | Exposes clear_settings in package exports and updates all. |
| tox.ini | Switches dependency_groups from testing to dev to match pyproject. |
| pyproject.toml | Renames dependency group to dev, adjusts extras for napari, adds dev-time dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces significant improvements to settings management and persistence in the
ndev-settingspackage, including a robust new implementation of theSettingsclass, enhanced plugin compatibility documentation, and dependency adjustments. The new system ensures reliable merging, caching, and resetting of settings, with improved handling for package discovery and editable installs.Major settings management improvements:
Settingsclass insrc/ndev_settings/_settings.pyto robustly manage persistent settings:appdirs, with automatic merging from all installed packages via entry points.clear_settingsfunction to delete cached settings and force re-discovery.reset_values_to_defaultslogic insrc/ndev_settings/_cli.py:_. [1] [2] [3]User-facing enhancements:
README.mdwith detailed documentation:Dependency and packaging updates:
appdirsas a required dependency inpyproject.tomlfor platform-appropriate config storage.API and export changes:
clear_settingsfunction from the package root insrc/ndev_settings/__init__.py.These changes provide a more reliable, user-friendly, and extensible settings system for ndev plugins, with clear documentation and improved developer experience.