potiuk commented on a change in pull request #13409:
URL: https://github.com/apache/airflow/pull/13409#discussion_r553198440



##########
File path: Dockerfile.ci
##########
@@ -314,56 +327,34 @@ COPY airflow/__init__.py 
${AIRFLOW_SOURCES}/airflow/__init__.py
 ARG UPGRADE_TO_NEWER_DEPENDENCIES="false"
 ENV UPGRADE_TO_NEWER_DEPENDENCIES=${UPGRADE_TO_NEWER_DEPENDENCIES}
 
+# Those are additional constraints that are needed for some extras but we do 
not want to
+# Force them on the main Airflow package. Those limitations are:
+# * chardet,<4: required by snowflake provider 
https://github.com/snowflakedb/snowflake-connector-python/blob/v2.3.6/setup.py#L201
+# * lazy-object-proxy<1.5.0: required by astroid
+# * pyOpenSSL: Imposed by snowflake provider 
https://github.com/snowflakedb/snowflake-connector-python/blob/v2.3.6/setup.py#L201
+# * requests>=2.20.0,<2.24.0: required by snowflake provider 
https://github.com/snowflakedb/snowflake-connector-python/blob/v2.3.6/setup.py#L201
+# * urllib3<1.26: Required to keep boto3 and snowflake happy
+
+ARG EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS="chardet<4 lazy-object-proxy<1.5.0 
pyOpenSSL<20.0.0 requests>=2.20.0,<2.24.0 urllib3<1.26"
+
+ARG CONTINUE_ON_PIP_CHECK_FAILURE="false"
+
 # The goal of this line is to install the dependencies from the most current 
setup.py from sources
 # This will be usually incremental small set of packages in CI optimized 
build, so it will be very fast
 # In non-CI optimized build this will install all dependencies before 
installing sources.
 # Usually we will install versions based on the dependencies in setup.py and 
upgraded only if needed.
 # But in cron job we will install latest versions matching setup.py to see if 
there is no breaking change
 # and push the constraints if everything is successful
 RUN if [[ ${INSTALL_FROM_PYPI} == "true" ]]; then \
-        if [[ "${UPGRADE_TO_NEWER_DEPENDENCIES}" != "false" ]]; then \
-            pip install -e ".[${AIRFLOW_EXTRAS}]" --upgrade --upgrade-strategy 
eager; \
-            pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"; \
-        else \
-            pip install -e ".[${AIRFLOW_EXTRAS}]" --upgrade --upgrade-strategy 
only-if-needed\
-                --constraint "${AIRFLOW_CONSTRAINTS_LOCATION}"; \
-            pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"; \
-        fi; \
+        /scripts/docker/install_airflow.sh; \
     fi
 
 # If wheel files are found in /docker-context-files during installation
 # they are also installed additionally to whatever is installed from Airflow.
 COPY docker-context-files/ /docker-context-files/
 
-# hadolint ignore=SC2086, SC2010
 RUN if [[ ${INSTALL_FROM_DOCKER_CONTEXT_FILES} == "true" ]]; then \
-        reinstalling_apache_airflow_package=$(ls 
/docker-context-files/apache?airflow?[0-9]*.{whl,tar.gz} 2>/dev/null || true); \
-        if [[ "${reinstalling_apache_airflow_package}" != "" ]]; then \
-            # install airflow with extras \
-            
reinstalling_apache_airflow_package="${reinstalling_apache_airflow_package}[${AIRFLOW_EXTRAS}]";
 \
-        fi; \
-        reinstalling_apache_airflow_providers_packages=$(ls 
/docker-context-files/apache?airflow?providers*.{whl,tar.gz} 2>/dev/null || 
true); \
-        if [[ ${reinstalling_apache_airflow_package} != "" || \
-              ${reinstalling_apache_airflow_providers_packages} == "" ]]; then 
\
-            if [[ "${UPGRADE_TO_NEWER_DEPENDENCIES}" != "false" ]]; then \
-                pip install --force-reinstall --upgrade --upgrade-strategy 
eager \
-                    --user ${reinstalling_apache_airflow_package} \
-                           ${reinstalling_apache_airflow_providers_packages}; \
-                pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"; \
-            else \
-                pip install --force-reinstall --upgrade --upgrade-strategy 
only-if-needed \
-                    --user ${reinstalling_apache_airflow_package} \
-                           ${reinstalling_apache_airflow_providers_packages} \
-                    --constraint "${AIRFLOW_CONSTRAINTS_LOCATION}"; \
-                pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"; \
-            fi; \
-        fi ; \
-        # All the other packages we want to reinstall as-is, without 
dependencies \
-        reinstalling_other_packages=$(ls /docker-context-files/*.{whl,tar.gz} 
2>/dev/null | \
-            grep -v apache_airflow | grep -v apache-airflow || true); \
-        if [[ "${reinstalling_other_packages}" != "" ]]; then \
-            pip install --force-reinstall --user --no-deps 
${reinstalling_other_packages}; \
-        fi; \
+        /scripts/docker/install_from_docker_contest_files.sh; \

Review comment:
       Good point. Fixed




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