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)
airflow/operators/python.py
self._write_args(input_filename)
            self._write_string_args(string_args_filename)
            write_python_script(
                jinja_context=dict(
                    op_args=self.op_args,
                    op_kwargs=self.op_kwargs,
                    pickling_library=self.pickling_library.__name__,
                    python_callable=self.python_callable.__name__,
                    python_callable_source=self.get_python_source(),
                ),
                filename=script_filename,
                render_template_as_native_obj=self.dag.render_template_as_native_obj,
            )
            execute_in_subprocess(
                cmd=[
                    f'{tmp_dir}/bin/python',
                    script_filename,
                    input_filename,
                    output_filename,
                    string_args_filename,
                ]
            )
            return self._read_result(output_filename)
    def get_python_source(self):
        """
        Returns the source of self.python_callable
        @return:
        """
        return dedent(inspect.getsource(self.python_callable))
    def _write_args(self, filename):