Replace deprecated pkg_resources with importlib.resources and improve path handling#76
Replace deprecated pkg_resources with importlib.resources and improve path handling#76
Conversation
|
@ilaflott 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
…on warnings Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
|
I think this could be improved by using the
|
J-Lentz
left a comment
There was a problem hiding this comment.
@copilot please address the comment above.
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Implemented the suggested improvements: now using pathlib.Path idiomatically with the Addressed @J-Lentz's feedback by implementing idiomatic pathlib.Path usage and removing debug verbosity. The code now uses |
|
@copilot remove the docstring edit you added- or make it compatible with |
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Fixed the flake8 whitespace issues in the docstring by removing trailing whitespace and cleaning up blank lines. The docstring is now compatible with flake8 linting and all whitespace issues have been resolved. Commit: b97c1e1 |
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Restored the verboseprint lambda function definition and all subsequent calls to the function as requested. The debug functionality is now fully operational while maintaining compatibility with pathlib.Path objects through str() conversion. No other changes were made. Commit: dc773f6 |
Replace deprecated pkg_resources with importlib.resources and improve path handling.
Analysis and Plan
/operatorChanges Made
Updated 3 validation files to:
import pkg_resources→import importlib.resourcesimportlib.resources.files('fms_yaml_tools') / "schema/..."instead of string concatenationUpdated validate_schema.py to:
Updated CI configuration:
Verification
✅ All 42 tests pass
✅ CLI tools function correctly with pathlib.Path objects
✅ No deprecation warnings when importing with
-W error::DeprecationWarning✅ Schema files remain accessible
✅ Debug parameter fully functional with verbose output when enabled
✅ Idiomatic pathlib.Path usage with
/operator✅ CI updated to test modern Python versions (3.9-3.12)
✅ flake8 linting passes with no warnings
The deprecation warnings shown in the issue will no longer appear when FRE users run frerun with fms-yaml-tools. The code now uses modern, idiomatic Python patterns while maintaining full debug functionality.
Fixes #75.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.