MAINT: Resolve high-priority CLI bugs (Version, Stderr, and Upload Type) #28#35
Open
MAINT: Resolve high-priority CLI bugs (Version, Stderr, and Upload Type) #28#35
Conversation
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.
This Pull Request addresses several High Priority requirements identified in #28 to bring the CBRAIN CLI closer to a production-ready 0.9/1.0 release. The focus of these changes is to stabilize the command execution flow, ensure standard stream compliance (POSIX), and resolve attribute errors in file management.
Key Improvements
versionfrom session validation.sys.stderr.SingleFileas the default--file-type.is_authenticated()network calls.1. Unauthenticated Version Access
main.pyto handle theversioncommand immediately after argument parsing.2. Standard Error (stderr) Redirection
stdout, polluting data pipes.parser.print_help()calls to utilizefile=sys.stderr, ensuringstdoutremains reserved for successful data payloads.3. File Upload Attribute Stability
--file-typeflag caused anAttributeErrorwithin theNamespaceobject.--file-typein the parser with a default value of"SingleFile", preventing crashes and simplifying the user experience.4. Optimized Request Logic
Verify Test Cases
python -m cbrain_cli.main version-> PASS (Returns version info without login).python -m cbrain_cli.main file > out.txt-> PASS (Usage text sent to terminal;out.txtis empty).python -m cbrain_cli.main file upload --data-provider 15 --group-id 3 README.md-> PASS (NoAttributeError; initiates upload process).