Jianxuan-Li opened a new issue, #29595:
URL: https://github.com/apache/airflow/issues/29595

   ### Description
   
   Hello all,
   
   Is it possible to allows user import a `requirements.txt` file by the 
`docker-compose` file, then install the required packages?
   For example in our project we uses a lot of packages, and lock them by the 
`poetry` (link: [https://python-poetry.org/](https://python-poetry.org/)). We 
can export a requirements file with the hash-tags for packages like this:
   
   ```
   asgiref==3.5.2; python_version >= "3.7" \
       
--hash=sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4 \
       
--hash=sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424
   brotli==1.0.9; platform_python_implementation == "CPython" and 
python_version >= "3.7" \
       
--hash=sha256:268fe94547ba25b58ebc724680609c8ee3e5a843202e9a381f6f9c5e8bdb5c70 \
       
--hash=sha256:c2415d9d082152460f2bd4e382a1e85aed233abc92db5a3880da2257dc7daf7b \
       
--hash=sha256:5913a1177fc36e30fcf6dc868ce23b0453952c78c04c266d3149b3d39e1410d6 \
       
--hash=sha256:afde17ae04d90fbe53afb628f7f2d4ca022797aa093e809de5c3cf276f61bbfa 
   brotlicffi==1.0.9.2; platform_python_implementation != "CPython" and 
python_version >= "3.7" \
       
--hash=sha256:408ec4359f9763280d5c4e0ad29c51d1240b25fdd18719067e972163b4125b98 \
   cffi==1.15.1; platform_python_implementation != "CPython" and python_version 
>= "3.7" \
       
--hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \
       
--hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 
   coverage==5.5; (python_version >= "2.7" and python_full_version < "3.0.0") 
or (python_full_version >= "3.5.0" and python_version < "4") \
       
--hash=sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf \
       
--hash=sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b 
   cssselect2==0.6.0; python_version >= "3.7" \
       
--hash=sha256:3a83b2a68370c69c9cd3fcb88bbfaebe9d22edeef2c22d1ff3e1ed9c7fa45ed8 \
       
--hash=sha256:5b5d6dea81a5eb0c9ca39f116c8578dd413778060c94c1f51196371618909325
   fonttools==4.37.1; python_version >= "3.7" \
       
--hash=sha256:fff6b752e326c15756c819fe2fe7ceab69f96a1dbcfe8911d0941cdb49905007 \
       
--hash=sha256:4606e1a88ee1f6699d182fea9511bd9a8a915d913eab4584e5226da1180fcce7
   html5lib==1.1; python_version >= "3.7" and python_full_version < "3.0.0" or 
python_full_version >= "3.5.0" and python_version >= "3.7" \
       
--hash=sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d \
       
--hash=sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f
   itsdangerous==2.1.2; python_version >= "3.7" \
       
--hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \
       
--hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a
   pillow==8.4.0; python_version >= "3.6" \
       
--hash=sha256:81f8d5c81e483a9442d72d182e1fb6dcb9723f289a57e8030811bac9ea3fef8d \
       
--hash=sha256:3f97cfb1e5a392d75dd8b9fd274d205404729923840ca94ca45a0af57e13dbe6 
   pycparser==2.21; python_version >= "3.7" and python_full_version < "3.0.0" 
or python_full_version >= "3.4.0" and python_version >= "3.7" \
       
--hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \
       
--hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206
   pydyf==0.2.0; python_version >= "3.7" \
       
--hash=sha256:f0468bc644d3a5b0a7072d0d92bd5c024cf4beede0df56100d9919a59f15e1f0 \
       
--hash=sha256:06ebc18b4de29fc1450ae49dd142ecd26bd7ba09d0b1919e365fbc3d8af8a622
   pyphen==0.12.0; python_version >= "3.7" \
       
--hash=sha256:459020cd320eb200c0c5ba46b98b2278fd34c5546f520fdcd2ce5f8d733eb994 \
       
--hash=sha256:b7d3dfc24b6f2178cdb2b1757ace0bd5d222de3e62c28d22ac578c5f22a13e9b
   pytz==2022.2.1 \
       
--hash=sha256:220f481bdafa09c3955dfbdddb7b57780e9a94f5127e35456a48589b9e0c0197 \
       
--hash=sha256:cea221417204f2d1a2aa03ddae3e867921971d0d76f14d87abb4414415bbdcf5
   shortuuid==1.0.9; python_version >= "3.5" \
       
--hash=sha256:b2bb9eb7773170e253bb7ba25971023acb473517a8b76803d9618668cb1dd46f \
       
--hash=sha256:459f12fa1acc34ff213b1371467c0325169645a31ed989e268872339af7563d5
   six==1.16.0; python_version >= "3.7" and python_full_version < "3.0.0" or 
python_full_version >= "3.5.0" and python_version >= "3.7" \
       
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 \
       
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926
   sorl-thumbnail==12.9.0; python_version >= "3.7" \
       
--hash=sha256:0cbc2f52152e7f2266e3c2cb4ae5d83afd2e96fd5e1c42e5667362baaa3d2db3 \
       
--hash=sha256:ec586724bea7dc8c53561ce18335ea641fcd0e560d6387b2353a2afdd06705a4
   sqlparse==0.4.2; python_version >= "3.7" \
       
--hash=sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d \
       
--hash=sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae
   tinycss2==1.1.1; python_version >= "3.7" \
       
--hash=sha256:fe794ceaadfe3cf3e686b22155d0da5780dd0e273471a51846d0a02bc204fec8 \
       
--hash=sha256:b2e44dd8883c360c35dd0d1b5aad0b610e5156c2cb3b33434634e539ead9d8bf
   
   webencodings==0.5.1; python_version >= "3.7" and python_full_version < 
"3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7" \
       
--hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \
       
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923
   zopfli==0.2.1; python_version >= "3.7" \
       
--hash=sha256:2f61ecd57bc47684c44a60e8cecb8e67f633cf238f30cc255627e172119ad72d \
       
--hash=sha256:a8ca5b541544a7b959fdf5a8f614c52a31002e4be489663d835aadeef3473cb0
   ```
   
   Once user has a non-empty requirements file map to a path like 
`/opt/airflow/addition-requirements.txt` then we install the requirements when 
user start the docker containers.
   
   ### Use case/motivation
   
   Since for some of the packages hashtag is important especially the private 
packages may have version conflict, I think it is good to have a feature that 
allows me import the requirement file into the docker-compose file in the 
development. For now I maintain a project that required many public packages 
and private packages, I hope I can install them by a requirements file instead 
of using `_PIP_ADDITIONAL_REQUIREMENTS`.
   
   Thank all of you!
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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