ashb commented on a change in pull request #4938: [AIRFLOW-4117] Multi-staging Image - Travis CI tests [Step 3/3] URL: https://github.com/apache/airflow/pull/4938#discussion_r303216801
########## File path: scripts/ci/_force_python_3.6.sh ########## @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Force Python version to 3.6 for some scripts +export PYTHON_BINARY=python3.6 + +# And fail in case it is not available +if [[ ! -x "$(command -v "${PYTHON_BINARY}")" ]]; then + echo >&2 + echo >&2 "${PYTHON_BINARY} is missing in your \$PATH" + echo >&2 + echo >&2 "Please install Python 3.6 and make it available in your path" + echo >&2 + exit 1 +fi + +# Set python version variable to force it in the scripts as well +PYTHON_VERSION=3.6 +export PYTHON_VERSION Review comment: Code organisation point: There are a lot of these "helper" scripts that are sourced. What do you think to combining them in to a `scripts/ci/_utils.sh` as functions, so this would be used something like: ```bash . "${MY_DIR}"/_utils.sh airflow_force_python_3_6 ``` etc. ---------------------------------------------------------------- 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] With regards, Apache Git Services
