Skip to content

Instantly share code, notes, and snippets.

@thatwist
Created August 16, 2025 15:18
Show Gist options
  • Save thatwist/c2f5014da15238064824a7d8536c3eb5 to your computer and use it in GitHub Desktop.
Save thatwist/c2f5014da15238064824a7d8536c3eb5 to your computer and use it in GitHub Desktop.
Airflow install on Termux Android 12 (with some providers)
#!/bin/bash
mkdir -p ~/airflow
python -m venv ~/airflow/.venv source ~/airflow/.venv/bin/activate
# add e.g. for fish in .config/fish/config.fish: set -gx AIRFLOW_HOME "~/airflow"
AIRFLOW_VERSION=3.0.4
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
#e.g. https://raw.githubusercontent.com/apache/airflow/constraints-3.0.4/constraints-3.12.txt
# grpcio&uvloop installation optimized for termux android version 12
# grpcio
GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 GRPC_PYTHON_BUILD_SYSTEM_CARES=1 CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31 -include unistd.h" LDFLAGS+=" -llog" pip install grpcio==1.65.5
# uvloop
CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31 -include unistd.h" LDFLAGS+=" -llog" pip install uvloop==0.21.0
#plain airflow installation
#pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
# required by postgres provider
pkg install postgresql -y
pkg install libxml2 libxslt -y
CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31 -include unistd.h" LDFLAGS+=" -llog" pip install lxml==5.4.0
# you may also need to install pandas separately (lookup on google installing pandas on termux)
#apache-kafka requires librdkafka
#WIP: install librdkafka #pkg install git make cmake automake autoconf libtool pkg-config openssl zlib
#git clone https://github.com/confluentinc/librdkafka.git
#cd librdkafka
#./configure --prefix=$PREFIX #make
#make install
pip install "apache-airflow[async,celery,cncf.kubernetes,amazon,postgres,redis,apache-spark,apache-cassandra,duckdb]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
#vars substituted
#pip install gevent==25.5.1
#pip install "apache-airflow[async,celery,cncf.kubernetes,amazon,postgres,redis,duckdb,apache-spark,apache-cassandra]==3.0.4" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.0.4/constraints-3.12.txt"
# conflicts over 'ray' package
#pip install apache-airflow==3.0.4 apache-airflow-providers-google==17.0.0
#snowflake extra requires building pyarrow==0.18.1 which is problematic
#pip install "apache-airflow==${AIRFLOW_VERSION}" "snowflake-connector-python[pandas]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment