Currently the operator allows to set requirement as list that needs to be hard coded.
It would be nice if airflow can support reading from file directly (something similar to how operators read sql file)
tests/operators/test_python.py
"""Ensure all template context fields are listed in the operator.
    This exists mainly so when a field is added to the context, we remember to
    also add it to PythonVirtualenvOperator.
    """
    
    
    
    intentionally_excluded_context_keys = [
        "task_instance",
        "ti",
        "var",  
        "conn",  
    ]
    ti = create_task_instance(
        dag_id="test_virtualenv_serializable_context_fields",
        task_id="test_virtualenv_serializable_context_fields_task",
        schedule_interval=None,
    )
    context = ti.get_template_context()
    declared_keys = {
        *PythonVirtualenvOperator.BASE_SERIALIZABLE_CONTEXT_KEYS,
        *PythonVirtualenvOperator.PENDULUM_SERIALIZABLE_CONTEXT_KEYS,
        *PythonVirtualenvOperator.AIRFLOW_SERIALIZABLE_CONTEXT_KEYS,
        *intentionally_excluded_context_keys,
    }
    assert set(context) == declared_keys