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
if self.op_args or self.op_kwargs:
            with open(filename, 'wb') as file:
                self.pickling_library.dump({'args': self.op_args, 'kwargs': self.op_kwargs}, file)
    def _iter_serializable_context_keys(self):
        yield from self.BASE_SERIALIZABLE_CONTEXT_KEYS
        if self.system_site_packages or 'apache-airflow' in self.requirements:
            yield from self.AIRFLOW_SERIALIZABLE_CONTEXT_KEYS
            yield from self.PENDULUM_SERIALIZABLE_CONTEXT_KEYS
        elif 'pendulum' in self.requirements:
            yield from self.PENDULUM_SERIALIZABLE_CONTEXT_KEYS
    def _write_string_args(self, filename):
        with open(filename, 'w') as file:
            file.write('\n'.join(map(str, self.string_args)))
    def _read_result(self, filename):
        if os.stat(filename).st_size == 0:
            return None
        with open(filename, 'rb') as file:
            try:
                return self.pickling_library.load(file)
            except ValueError:
                self.log.error(
                    "Error deserializing result. Note that result deserialization "
                    "is not supported across major Python versions."
                )
                raise
    def __deepcopy__(self, memo):