-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Airflow installation fails when with latest setuptools
#18075
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Looks like this should be submitted to pallets-eco/flask-openid#59 instead. |
Unfortunately this is one of the things that is not possible to handle in Airflow in already released versions, as the right version of setuptools need to be installed before airflow installation and related packages are attempted to be installed. However if @mitsuhiko fixes it and release flask-openid without 2_to_3, we will be able to re-pin our constraints to use that new version of flask-openid in our constraints for all released versions of Airflow. So we really depend on this. |
For now - workaround is to use setuptools < 58.0.2 |
We've figured a possible automated workaround with @uranusjr . Stay tuned. |
@potiuk looking forward to this |
My current workaround in my dockerfile: # install Airflow with constraints file for compatibility
ARG AIRFLOW_VERSION=2.0.1
ARG PYTHON_VER=3.7
ARG CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VER}.txt"
RUN pip3 install --upgrade pip && \
pip install -U pip setuptools==58.0.1 wheel \
&& pip install "apache-airflow[statsd]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}" \
&& pip install pyOpenSSL \
&& pip install ffmpeg-python |
Yep. For Dockerfile it's easy. But we have a better workaround. Just tested and it works. the problem is that it also broke all Airflow 2 installations which people already use and any attempt to install those, will fail. We have a fix that will make the "official installation method" works for all Airflow 2 releases. |
All right - 2.1.3 should now work when you install it with constraints with latest setuptools:
Can someone confirm it ? then I will apply the same fix to other released versions and carry on with fixing it for main as well |
let me try this |
Fr those curious ones - I'we built Flask-OpenId 1.2.6 with removed 2_to_3, we host it here: https://github.com/apache/airflow-flask-openid-fork/releases/tag/v1.2.6 and our constraints have been updated to install it from there: |
@potiuk just tried building my dockerfile again with the following: # install Airflow with constraints file for compatibility
ARG AIRFLOW_VERSION=2.0.1
ARG PYTHON_VER=3.7
ARG CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VER}.txt"
RUN pip3 install --upgrade pip && \
pip install -U pip setuptools wheel \
&& pip install "apache-airflow[statsd]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}" \
&& pip install pyOpenSSL \
&& pip install ffmpeg-python It results in the following error:
|
2.0.1 is not yet fixed (Only 2.1.3). I can fix it in 2.0.1 for your tests now |
try now @RafayAK - it should be ok for 2.0.1 as well |
(I need to manually apply the fix for all versions, so I want to confirm it works :) ) |
@potiuk Got it built thanks! I do get this warning though:
|
No problem with that warning - it's just yanked because of wrong setup information, but that's not an issue. Thanks for verification! I proceed with applying the fix then :) |
All right. Patched all released constraints. For the record and keeping track:
I will close the issue where we also solve it in the "main" and apply to upcoming 2.1.4 (we still need to automate that as it was manual) |
hey team I am using airflow 1.10.10 and just faced this error on build can we apply to lower versions as well? @potiuk 🙏 |
You can apply this line to your requirements yourself:
A recent pip version should pick up the line automatically. If you’re stuck on an old pip version, |
Yep. With 1.10 you are pretty much on your own. 1.10 reached end-of-life and we are not going to make any workaronds or even critical security fixes there. As @uranusjr wrote - you have to workaround it yourself with the patch, or (might be simpler) run |
ah cool. yes thanks @uranusjr that worked! |
BTW. I am also discussing with other people affected and we tapped into our network to possibly fix the problem by releasing updated Flask-OpenID, In which case we will be able to fix it "permanently" and not as workaround. 🤞 |
@potiuk Airflow installation via
with
|
More context: pallets-eco/flask-openid#60 apache/airflow#18075 Using Airflow patched fork for now
You should upgrade to newer PIP version.
|
As of 6th of September 2021, setuptools released 50.0.2 followed by 50.0.3 release - both of which fail Flask-OpenId installation. This broken Airflow installation. It's been workarounded for released version of Airflow by publishing patched version of FlaskOpenID in Airflow GitHub repository. This change adapts our main and constraint generation to include automated generation of the special Flask-OpenId dependency. With this change: 1) Setuptools is pinned to 50.0.3 (to make sure our builds work with that version - this can also give us more control in the future. 2) Flask-OpenID is installed explicitly before airflow is installed when eager-upgrade is used Closes: apache#18075
This has been fixed now. Thanks to @mitsuhiko I became maintainer of the Flask-OpenID and I released new 1.3.0 version, Python3 - only with removed 2to3 configuration. It should nicely install now with the new setuptools ! |
thanks, can confirm:
and there's a wheel so no setuptools needed! |
Yeah. I also released wheel on request of @uranusjr and @kaxil :). Glad we could solve it that quickly. I am going to delete https://github.com/apache/airflow-flask-openid-fork today. |
Apache Airflow version
2.1.3
Operating System
Ubuntu 20.04
Versions of Apache Airflow Providers
NA
Deployment
Other Docker-based deployment
Deployment details
Ubuntu Docker image, Airflow installed inside a
virtualenv
in the image.What happened
Trying to pip-install Airflow in a virtualenv where
setuptools
is>=58.0.2
fails:The
setuptools
team deprecateduse_2to3
(see pypa/setuptools#2086) recently and this is breaking installation of packages which rely on that legacy key. In the case of Airflow,Flask-OpenID
, required byFlask-AppBuilder
, is the offending dependency. See https://github.com/mitsuhiko/flask-openid/blob/v1.2.5/setup.py#L32.This should probably be fixed by that project's maintainers, but we (Meltano) thought it was a good idea to file this issue here in case Airflow users run into the problem. Just removing
use_2to3
seems to work 😃.What you expected to happen
Airflow's dependencies should be prepared for new versions of
setuptools
and Python (3.10
).How to reproduce
Anything else
The current workaround it to make sure a version of
setuptools
prior to58.0.0
is installed in the active Python environment.Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: