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

Introspection for dataclasses with inheritance #6

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

couling
Copy link
Owner

@couling couling commented Feb 13, 2024

Fixed bug where inheritance of dataclasses was not properly explored.

This should now work as expected:

    @dataclass()
    class Parent:
        foo: Annotated[int | None, option()]

    @dataclass
    class Config(Parent):
        bar: Annotated[int | None, option()]

    @click.command()
    @dataclass_click(Config)
    def main(*args, **kwargs):
        results.append((args, kwargs))

@couling couling added the bug Something isn't working label Feb 13, 2024
@couling couling merged commit 51c26cd into main Feb 13, 2024
3 checks passed
@couling couling deleted the inheritance branch February 13, 2024 18:56
@couling couling changed the title Introspection for inheritance Introspection for dataclasses with inheritance Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant