gusty 0.5.0 introduces an intuitive way to use .py files as task files. The full release notes for gusty 0.5.0 can be found [here](https://github.com/chriscardillo/gusty/releases/tag/v0.5.0).
In short, by default, gusty treats .py files in DAG directory as a file to be executed by Airflow's `PythonOperator`, meaning your .py file can say as little as:
python
print("this will become an operator")
and gusty will take care of the rest.
Of course, .py files can be configured just like any other task file. For this, gusty reads raw markdown in the following format at the beginning of your file.
python
---
operator: airflow.operators.python.PythonVirtualenvOperator
requirements:
- "siuba==0.0.24"
python_callable: print_phrase
---
def print_phrase():
print("this will become an operator")
We designated a new `operator`, whose arguments include `requirements`, and we specified a `python_callable`, which tells gusty that there is a defined function named `print_phrase` that we want to use as the `python_callable` function for our operator.
Please note gusty will only search for/attach an actual callable function to `python_callable` when the operator inherits from Airflow's `PythonOperator` class.