-
Notifications
You must be signed in to change notification settings - Fork 6
Cli polishing #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Cli polishing #109
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4ce1c94
Update UNSURE to be UNCLEAR, catch __USURE received from the service
0509691
Add basic catch if api token isn't specified when cli is called
04e4cda
Pushes Groundlight class instantiation up until the function is actua…
3eddd0b
Revert "Update UNSURE to be UNCLEAR, catch __USURE received from the …
8c29eb4
Automatically reformatting code
ea5631a
Fixed misunderstanding with metaprogramming, added tests
b2b9d9b
Merge branch 'cli_update' of github.com:groundlight/python-sdk into c…
5a06090
Automatically reformatting code
823cc19
Addressing comments
5bd8344
Merge branch 'cli_update' of github.com:groundlight/python-sdk into c…
ea8f853
Automatically reformatting code
4580e31
caught failed test that github was ready to ignore
1876c32
lint
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,9 @@ | |
| "API_TOKEN_VARIABLE_NAME", | ||
| "DEFAULT_ENDPOINT", | ||
| ] | ||
|
|
||
| API_TOKEN_HELP_MESSAGE = ( | ||
| "No API token found. Please put your token in an environment variable " | ||
| f'named "{API_TOKEN_VARIABLE_NAME}". If you don\'t have a token, you can ' | ||
| f"create one at {API_TOKEN_WEB_URL}" | ||
| ) | ||
|
Comment on lines
+12
to
+16
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great idea to standardize this |
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the help message, it truncates the descriptions of the sub-commands. Is there a way to have it print out the full line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the help page for a specific command, the description's formatting can be a little weird because it doesn't respect single newlines. (I understand that
typer.Argument()would fix this if we could use it, but it doesn't work because ofUniontypes).But I think the fix is actually pretty easy -- when we want a newline to show up in the generated message, we should just put in a blank line in the docstring. For example:
Which then looks better:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstrings are undergoing continual improvement, they'll all hopefully use the double new line once we finish working out the sphinx stuff.
Turns out not truncating lines was just a matter of adding a param to the context_settings of the typer app.