Skip to content

Respect runtime-required decorators on functions#9317

Merged
charliermarsh merged 1 commit intomainfrom
charlie/runtime-decorator
Dec 30, 2023
Merged

Respect runtime-required decorators on functions#9317
charliermarsh merged 1 commit intomainfrom
charlie/runtime-decorator

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

This PR modifies the semantics of runtime-evaluated-decorators to respect decorators on both classes and functions. Historically, this only respected classes, since the common use-case is (e.g.) pydantic.BaseModel -- but functions are equally valid.

Closes #9312.

Test Plan

cargo test

@charliermarsh charliermarsh added the configuration Related to settings and configuration label Dec 29, 2023
@charliermarsh charliermarsh force-pushed the charlie/runtime-decorator branch from 2ddfa62 to 0cd5e41 Compare December 29, 2023 22:32
@charliermarsh charliermarsh requested a review from zanieb December 29, 2023 22:33
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit 9472799 into main Dec 30, 2023
@charliermarsh charliermarsh deleted the charlie/runtime-decorator branch December 30, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Related to settings and configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runtime-evaluated-decorators not working for the annotations of decorated functions.

2 participants