quickie.factories
Factories for creating tasks from functions.
We can create tasks from functions using the task, script, and command decorators. Additionally, we can add arguments to the tasks using the arg decorator.
@task(
name="hello"
args=[
Arg("number1", type=int, help="The first number."),
Arg("number2", type=int, help="The second number."),
]
)
def sum(number1, number2):
console.print(f"The sum is {number1 + number2}.")
@script(args=["--name"])
def sum(name="world"):
"""Docstring will be used as help text."""
return f"echo Hello, {name}!"
@command
def compose():
return ["docker", "compose", "up"]
Module Attributes
|
Used for type hinting the return type of a decorator. |
|
Used for type hinting the return type of a decorator. |
Functions
|
Create a command task from a function. |
|
Create a group task from a function. |
|
Create a script from a function. |
|
Create a task from a function. |
|
Create a task class from a function. |
|
Create a thread group task from a function. |
Classes
|
Common keyword arguments for task decorators. |