Skip to content

Typing args (initial) #418

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

Open
wants to merge 62 commits into
base: develop
Choose a base branch
from
Open

Typing args (initial) #418

wants to merge 62 commits into from

Conversation

gcie
Copy link
Collaborator

@gcie gcie commented Mar 13, 2025

Fixes / Features

  • initial solution to typing args parameter
  • proof of concept on storage related commands

@gcie gcie marked this pull request as ready for review April 24, 2025 11:39
@gcie gcie self-assigned this Apr 24, 2025
]


class StorageAttachArgs(ClusterConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

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

StorageAttachArgs and StorageCreateArgs share many fields. Can we move them to new, shared class?

from typing import Any


def apply_args(main_args: Namespace, annotation: Any) -> Any:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bad naming imo. What does apply_args mean?



def apply_args(main_args: Namespace, annotation: Any) -> Any:
args = annotation()
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no information that annotation is callable. Please add docstring for this function

mount_options: Optional[str] = 'implicit-dirs'


class StorageCreateArgs(ClusterConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it should be dataclass? If I want to test StorageCreate command in unit tests(in the future) and I want to pass StorageCreateArgs, is there any way to pass them via constructor?

Copy link
Collaborator

Choose a reason for hiding this comment

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

] # The project name lives on the last line of the output


def get_zone():
Copy link
Collaborator

Choose a reason for hiding this comment

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

This are general functions, not specific to args. Maybe they should be moved to utils?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants