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/decorators/test_python_virtualenv.py
@task.virtualenv
        def f(a, b, c=False, d=False):
            if a == 0 and b == 1 and c and not d:
                return True
            else:
                raise Exception
        with self.dag:
            ret = f(0, 1, c=True)
        ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
    def test_return_none(self):
        @task.virtualenv
        def f():
            return None
        with self.dag:
            ret = f()
        ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
    def test_nonimported_as_arg(self):
        @task.virtualenv
        def f(_):
            return None
        with self.dag:
            ret = f(datetime.datetime.utcnow())
        ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)