pyyaml is no longer a required dependency - #970
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #970 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 8729 8736 +7
=========================================
+ Hits 8729 8736 +7 ☔ View full report in Codecov by Harness. |
|
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.



What does this PR do?
Fixes #229
Makes
pyyamloptional for v5, sopip install jsonargparsenow installs with no required dependencies. Install theyamlextras (included inall) to get it.Support for running without
pyyamlalready existed internally. This completes it:dependencieshas been removed. Theyamlextras is unchanged.import_pyyamlhelper, following the existingimport_jsonnet/import_toml_*pattern, raisesPyYAML package is required by <importer>instead of a bareModuleNotFoundError. Theparser_modesetter now uses it, soparser_mode="yaml"fails at parser creation rather than at the first value that needs the loader, the same asparser_mode="jsonnet"already did.dump_using_formatfalls back tojsoninstead ofyamlwhen the parser mode has no dumper andpyyamlis not installed.without-pyyamltox env and the steps that uninstalledpyyamlin the tests workflow. Theno-extrastox env and the bare CI job now cover that case by construction.Also removes a stray
parser.parser_mode = "yaml"intest_float_implicit_leading_zerothat was defeating its own@parser_modesparametrization.Without
pyyaml, the defaultparser_modeand dump format isjson. This is a breaking change for v5 with no deprecation warning, already noted in the migration guide.Before submitting