Limess commented on issue #13149:
URL: https://github.com/apache/airflow/issues/13149#issuecomment-754107541


   Not to ignore the above discussion, but for the benefit of anyone else using 
poetry on top of airflow in a workflow similar to the following who is 
experiencing issues with flask-openid:
   1. Use the official Airflow docker image
   2. Export requirements from poetry so we can use the Airflow constraints file
   3. Globally install on top of the base Airflow dependencies using the 
airflow constraints file to ensure we get what the Airflow team deems 'golden'
   
   I had to add `python3-openid` to our `poetry.toml` as above, but I _also_ 
had to remove `python-openid` from the output `requirements.txt`, otherwise we 
still had it floating around and causing issues. As the poetry issues 
(https://github.com/python-poetry/poetry/issues/1287) says, this is a problem 
with `flask-openid`, not poetry :
   
   ```dockerfile
   RUN export PYTHON_MAJOR_MINOR_VERSION=$(python -c 'import sys; 
print("%s.%s"% (sys.version_info.major, sys.version_info.minor))') \
     && AIRFLOW_MINOR_VERSION=$(echo "$AIRFLOW_VERSION" | cut -d "." -f 
1)-$(echo "$AIRFLOW_VERSION" | cut -d "." -f 2) \
     && curl -sSL 
"https://raw.githubusercontent.com/apache/airflow/constraints-$AIRFLOW_MINOR_VERSION/constraints-$PYTHON_MAJOR_MINOR_VERSION.txt";
 > ./airflow-constraints.txt \
     && poetry export --without-hashes -f requirements.txt -o 
./requirements.txt \
     # flask-openid does not correctly specify version constraints 
https://github.com/python-poetry/poetry/issues/1287
     && echo "remove python-openid from poetry packages as it's pulled in 
incorrectly by flask-openid" \
     && sed -i '/^python-openid==/d' ./requirements.txt \
     && pip install --user --no-cache-dir --upgrade pip==${PIP_VERSION} \
     && pip install --user --no-cache-dir --no-warn-script-location -r 
./requirements.txt --constraint ./airflow-constraints.txt \
     && rm -rf ~/.cache ./requirements.txt ./airflow-constraints.txt
   ```
   


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

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


Reply via email to