Skip to content
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

refacto: commands were cluttered + no cli help #111

Merged
merged 3 commits into from
Nov 21, 2022
Merged

Conversation

AmozPay
Copy link
Contributor

@AmozPay AmozPay commented Oct 6, 2022

Solution: put all commands in a sub folder and use typer subcommands
Use typer.Option and typer.Argument to document each command parameter

@AmozPay AmozPay force-pushed the AmozPay-typer-doc branch 3 times, most recently from 39bd4cf to c88639d Compare October 6, 2022 08:49
Copy link
Member

@hoh hoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good !

I added a few comments and would like to test it before approving it.

Since it changes the command-line interface, I will want to publish a version before the one containing these changes.

src/aleph_client/cli_utils.py Outdated Show resolved Hide resolved
src/aleph_client/cli_utils.py Outdated Show resolved Hide resolved

from aleph_client.cli_utils import (
_setup_logging,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using parenthesis here seems useless and overkill.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

channel = "Aleph network channel where the message is located"
private_key = "Your private key. Cannot be used with --private-key-file"
private_key_file = "Path to your private key file"
ref = "Checkout https://aleph-im.gitbook.io/aleph-js/api-resources-reference/posts"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants are usually in UPPER_CASE in Python.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

src/aleph_client/commands/message.py Outdated Show resolved Hide resolved
@AmozPay AmozPay force-pushed the AmozPay-typer-doc branch 2 times, most recently from 2359b60 to 5127fa4 Compare October 7, 2022 08:21
@hoh hoh mentioned this pull request Oct 27, 2022
@mrhouzlane
Copy link
Contributor

mrhouzlane commented Nov 15, 2022

Command whoami (Display your public address) missing in the subcommands.

Command whoami is on the main file, so it's ok.

Solution: put all commands in a sub folder and use typer subcommands
Use typer.Option and typer.Argument to document each command parameter
@AmozPay
Copy link
Contributor Author

AmozPay commented Nov 17, 2022

Did a force push since I rebased the current branch on main.

It adds the persistent programs option in aleph program upload and the unpersist command as aleph program unpersist

httpx is required in tests when using fastapi.testclient
@hoh
Copy link
Member

hoh commented Nov 21, 2022

The tests still fail due to an upgrade to mypy that adds stricter checks on other parts of the codebase.

@hoh hoh merged commit 0b17e09 into master Nov 21, 2022
@MHHukiewitz MHHukiewitz deleted the AmozPay-typer-doc branch September 25, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants