Repository navigation
Add safe YAML file reading and writing - #196
Gonghan-Princess wants to merge 5 commits into
Conversation
fabiocaccamo
left a comment
There was a problem hiding this comment.
@Gonghan-Princess thank you for this PR. I updated the requirements to avoid an error in the CI, but there is still a failing test, could you fix it please?
|
@Gonghan-Princess any update? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
+ Coverage 98.48% 98.51% +0.02%
==========================================
Files 13 13
Lines 794 808 +14
==========================================
+ Hits 782 796 +14
Misses 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi Fabio, I'm sorry for the long delay in getting back to you. I've been busy with some other commitments recently. I've now fixed the isolated import test and the README formatting issue in commits e680dc4 and 24ba931. The latest GitHub Actions matrix is green. Thank you for your patience and for reviewing this PR. |
Summary
Fixes #43.
read_file_yamlandwrite_file_yamlhelpers for a single YAML document, using PyYAML's safe loader and dumper.python-fsutil[yaml]and a lazy dependency check with an actionable installation hint; importing fsutil does not require PyYAML.Validation
Tested on Windows with Python 3.12.10 and PyYAML 6.0.3:
python -m pre_commit run --all-files --show-diff-on-failure: all configured checks passed, including mypy.python setup.py bdist_wheel, checked its conditional PyYAML dependency and source contents, and ran the README examples against the built wheel.The local environment has no pip module, so the initial pip-wheel command could not run; the wheel was subsequently built successfully with setuptools. Existing setuptools deprecation warnings remain. Other operating systems and Python versions were not run locally.
AI assistance
AI assisted with implementation, regression tests, validation, and this description. The contributor remains responsible for this submission. No third-party source code was copied; PyYAML is declared as an optional runtime dependency.