Skip to content

Conversation

@Lancetnik
Copy link

FastAPI and Pydantic supports a new feature: Annotated, but rocketry still doesn't.
It's a pretty usefull to declare some application-level Arguments and use it everywhere.

Code without Annotated:

arg = SimpleArg(1)

@app.task("...")
def func(dep: int = arg):
    ...

@app.task("...")
def func2(dep: int = arg):
    ...

Code with Annotated

from typing_extensions import Annotated

arg = SimpleArg(1)

ArgDep = Annotated[int, arg]

@app.task("...")
def func(dep: ArgDep):
    ...

@app.task("...")
def func2(dep: ArgDep):
    ...

I suppose, all packages, based on function signature, should implement this feature too. So, I am here to make it.

@Lancetnik
Copy link
Author

@Miksus, please take a look here! I want to get some feedback that the project is alive and still developing in order to use it further.

@Lancetnik Lancetnik changed the title Add Annorated supporting Add Annotated supporting Jun 28, 2023
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