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

Make path argument in all CLI commands optional using Argument callback #645

Open
1 task done
rominf opened this issue Jun 8, 2023 · 1 comment
Open
1 task done

Comments

@rominf
Copy link
Contributor

rominf commented Jun 8, 2023

quetz start allows to omit path argument and fallbacks to the current directory:

quetz/quetz/cli.py

Lines 538 to 542 in a189de8

if path:
deployment_folder = Path(path)
else:
deployment_folder = Path("")
path = os.getcwd()

However it's not the case for other commands. For example, quetz make-migrations without path fails with the exception:

TypeError: expected str, bytes or os.PathLike object, not NoneType

This is partially fixed by: #644 (because of proper annotations error message is more appropriate), but still, this is not consistent, and it could be more user-friendly.

I propose to make path argument in all CLI commands optional by using Argument callback for updating the value of path to current directory and validating it using _is_deployment function.

  • I am ready to create a PR.
@wolfv
Copy link
Member

wolfv commented Aug 22, 2023

This sounds very reasonable, too. Sorry that it took so long to get back to you.

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

No branches or pull requests

2 participants