timc commented on issue #36069:
URL: https://github.com/apache/airflow/issues/36069#issuecomment-1840882473

   A workaround is to define the dag as such:
   
   ```
   from some_util_file.py import load_reqs
   @task.virtualenv(use_dill=True, system_site_packages=False, 
requirements=load_reqs())
   ```
   
   where load_reqs is as follows:
   
   ```
   from pathlib import Path
   def load_reqs(file: str = 'requirements.txt'):
       with open(Path(__file__).parent / file) as f:
           return "\n".join(f.readlines())
   ```
   
   So the requirements content is effectively copied to another file and use in 
the venv.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to