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

Move the root options to a Pydantic Model #97

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

ephur
Copy link
Owner

@ephur ephur commented Jun 18, 2024

The long term is goal is to move all CLI configurations to models. Currently attributes are slapped onto one big inherited object and make it difficult to determine where something is coming from, and there is significant coupling.

Moving the options into a base model allows for all validation and conditional logic to be handled within the model, and then the model can be passed to places where the configuration may be needed. This will lessen the overuse of passing around big sets of kwargs and taking out what is needed, and will ensure that the CLI options are seamlessly available in all the different areas they are needed.

This starts with just the RootCommand, which takes the "global" or top level options.

The long term is goal is to move all CLI configurations to models.
Currently attributes are slapped onto one big inherited object and make
it difficult to determine where something is coming from, and there is
significant coupling.

Moving the options into a base model allows for all validation and
conditional logic to be handled within the model, and then the model
can be passed to places where the configuration may be needed. This
will lessen the overuse of passing around big sets of kwargs and
taking out what is needed, and will ensure that the CLI options
are seamlessly available in all the different areas they are needed.

This starts with just the RootCommand, which takes the "global" or
top level options.
@ephur ephur merged commit 1eed445 into master Jun 19, 2024
2 checks passed
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.

1 participant