fix(cli): preserve Windows drives in config section paths - #598
Open
rioyu123 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Rio Yu <52408936+rioyu123@users.noreply.github.com>
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 changed
Config paths support an optional
:sectionsuffix, but the current split treats the colon in a Windows drive letter as that delimiter. This centralizes the split so drive and UNC prefixes stay attached to the path, then reuses it for config export, dictionary export, path detection, and lazy@configloading.The existing section syntax from #182 is unchanged:
C:\tmp\config.yaml:modelresolves toC:\tmp\config.yamlplus sectionmodel. The lazy loader also keeps its existing section-name validation while allowing normal Windows paths, including paths with spaces.I also made the export error assertion use the actual captured
FileNotFoundError, since the rendered message is platform-specific.Validation
uv run -- pytest test/cli test/test_config.py test/run/test_experiment.py -q— 460 passeduv run ruff check nemo_run/cli/_paths.py nemo_run/cli/config.py nemo_run/cli/api.py nemo_run/cli/lazy.py test/cli/test_config_paths.py test/cli/test_api.pyuv run ruff format --check nemo_run/cli/_paths.py test/cli/test_config_paths.pygit diff --checkCloses #597