2019-07-18 14:18:26 +01:00
|
|
|
{ lib
|
2019-07-19 02:09:16 +01:00
|
|
|
, stdenv
|
2019-07-18 14:18:26 +01:00
|
|
|
, buildPythonPackage
|
2019-07-19 02:09:16 +01:00
|
|
|
, fetchFromGitHub
|
2019-11-15 21:14:25 +00:00
|
|
|
, fetchpatch
|
2019-07-18 14:18:26 +01:00
|
|
|
, alembic
|
2019-11-15 21:14:25 +00:00
|
|
|
, cached-property
|
2019-07-18 14:18:26 +01:00
|
|
|
, configparser
|
2019-11-15 21:14:25 +00:00
|
|
|
, colorlog
|
2019-07-18 14:18:26 +01:00
|
|
|
, croniter
|
|
|
|
, dill
|
|
|
|
, flask
|
|
|
|
, flask-appbuilder
|
|
|
|
, flask-admin
|
|
|
|
, flask-caching
|
|
|
|
, flask_login
|
|
|
|
, flask-swagger
|
|
|
|
, flask_wtf
|
2019-07-19 02:09:16 +01:00
|
|
|
, flask-bcrypt
|
2019-07-18 14:18:26 +01:00
|
|
|
, funcsigs
|
|
|
|
, future
|
|
|
|
, GitPython
|
|
|
|
, gunicorn
|
|
|
|
, iso8601
|
|
|
|
, json-merge-patch
|
|
|
|
, jinja2
|
2019-07-19 02:09:16 +01:00
|
|
|
, ldap3
|
2019-07-18 14:18:26 +01:00
|
|
|
, lxml
|
2019-11-15 21:14:25 +00:00
|
|
|
, lazy-object-proxy
|
2019-07-18 14:18:26 +01:00
|
|
|
, markdown
|
|
|
|
, pandas
|
|
|
|
, pendulum
|
|
|
|
, psutil
|
|
|
|
, pygments
|
|
|
|
, python-daemon
|
|
|
|
, python-dateutil
|
|
|
|
, requests
|
|
|
|
, setproctitle
|
2019-07-19 02:09:16 +01:00
|
|
|
, snakebite
|
2019-07-18 14:18:26 +01:00
|
|
|
, sqlalchemy
|
|
|
|
, tabulate
|
|
|
|
, tenacity
|
2019-11-15 21:14:25 +00:00
|
|
|
, termcolor
|
2019-07-18 14:18:26 +01:00
|
|
|
, text-unidecode
|
|
|
|
, thrift
|
|
|
|
, tzlocal
|
|
|
|
, unicodecsv
|
|
|
|
, zope_deprecation
|
|
|
|
, nose
|
2020-06-05 02:15:58 +01:00
|
|
|
, pythonOlder
|
|
|
|
, pythonAtLeast
|
2019-07-18 14:18:26 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "apache-airflow";
|
2019-11-15 21:14:25 +00:00
|
|
|
version = "1.10.5";
|
2020-06-05 02:15:58 +01:00
|
|
|
# Upstream does not yet support python 3.8
|
|
|
|
# https://github.com/apache/airflow/issues/8674
|
|
|
|
disabled = pythonOlder "3.5" || pythonAtLeast "3.8";
|
2019-07-18 14:18:26 +01:00
|
|
|
|
2019-11-15 21:14:25 +00:00
|
|
|
src = fetchFromGitHub rec {
|
2019-07-19 02:09:16 +01:00
|
|
|
owner = "apache";
|
|
|
|
repo = "airflow";
|
|
|
|
rev = version;
|
2019-11-15 21:14:25 +00:00
|
|
|
sha256 = "14fmhfwx977c9jdb2kgm93i6acx43l45ggj30rb37r68pzpb6l6h";
|
2019-07-18 14:18:26 +01:00
|
|
|
};
|
|
|
|
|
2019-11-15 21:14:25 +00:00
|
|
|
patches = [
|
|
|
|
# Not yet accepted: https://github.com/apache/airflow/pull/6562
|
|
|
|
(fetchpatch {
|
|
|
|
name = "avoid-warning-from-abc.collections";
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6562.patch";
|
2019-11-15 21:14:25 +00:00
|
|
|
sha256 = "0swpay1qlb7f9kgc56631s1qd9k82w4nw2ggvkm7jvxwf056k61z";
|
|
|
|
})
|
|
|
|
# Not yet accepted: https://github.com/apache/airflow/pull/6561
|
|
|
|
(fetchpatch {
|
|
|
|
name = "pendulum2-compatibility";
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6561.patch";
|
2019-11-15 21:14:25 +00:00
|
|
|
sha256 = "17hw8qyd4zxvib9zwpbn32p99vmrdz294r31gnsbkkcl2y6h9knk";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-07-18 14:18:26 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
alembic
|
2019-11-15 21:14:25 +00:00
|
|
|
cached-property
|
|
|
|
colorlog
|
2019-07-18 14:18:26 +01:00
|
|
|
configparser
|
|
|
|
croniter
|
|
|
|
dill
|
|
|
|
flask
|
|
|
|
flask-admin
|
2019-11-15 21:14:25 +00:00
|
|
|
flask-appbuilder
|
2019-07-19 02:09:16 +01:00
|
|
|
flask-bcrypt
|
2019-07-18 14:18:26 +01:00
|
|
|
flask-caching
|
|
|
|
flask_login
|
|
|
|
flask-swagger
|
|
|
|
flask_wtf
|
|
|
|
funcsigs
|
|
|
|
future
|
|
|
|
GitPython
|
|
|
|
gunicorn
|
|
|
|
iso8601
|
|
|
|
json-merge-patch
|
|
|
|
jinja2
|
2019-07-19 02:09:16 +01:00
|
|
|
ldap3
|
2019-07-18 14:18:26 +01:00
|
|
|
lxml
|
2019-11-15 21:14:25 +00:00
|
|
|
lazy-object-proxy
|
2019-07-18 14:18:26 +01:00
|
|
|
markdown
|
|
|
|
pandas
|
2019-11-15 21:14:25 +00:00
|
|
|
pendulum
|
2019-07-18 14:18:26 +01:00
|
|
|
psutil
|
|
|
|
pygments
|
|
|
|
python-daemon
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
setproctitle
|
|
|
|
sqlalchemy
|
|
|
|
tabulate
|
|
|
|
tenacity
|
2019-11-15 21:14:25 +00:00
|
|
|
termcolor
|
2019-07-18 14:18:26 +01:00
|
|
|
text-unidecode
|
|
|
|
thrift
|
|
|
|
tzlocal
|
|
|
|
unicodecsv
|
|
|
|
zope_deprecation
|
2019-11-15 21:14:25 +00:00
|
|
|
];
|
2019-07-18 14:18:26 +01:00
|
|
|
|
|
|
|
checkInputs = [
|
2019-07-19 02:09:16 +01:00
|
|
|
snakebite
|
2019-07-18 14:18:26 +01:00
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-03-28 01:05:53 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "flask>=1.1.0, <2.0" "flask" \
|
|
|
|
--replace "jinja2>=2.10.1, <2.11.0" "jinja2" \
|
|
|
|
--replace "pandas>=0.17.1, <1.0.0" "pandas" \
|
|
|
|
--replace "flask-caching>=1.3.3, <1.4.0" "flask-caching" \
|
|
|
|
--replace "flask-appbuilder>=1.12.5, <2.0.0" "flask-appbuilder" \
|
2020-07-02 04:25:12 +01:00
|
|
|
--replace "flask-admin==1.5.3" "flask-admin" \
|
|
|
|
--replace "flask-login>=0.3, <0.5" "flask-login" \
|
2020-03-28 01:05:53 +00:00
|
|
|
--replace "cached_property~=1.5" "cached_property" \
|
|
|
|
--replace "dill>=0.2.2, <0.3" "dill" \
|
|
|
|
--replace "configparser>=3.5.0, <3.6.0" "configparser" \
|
2020-04-09 19:19:09 +01:00
|
|
|
--replace "colorlog==4.0.2" "colorlog" \
|
2020-03-28 01:05:53 +00:00
|
|
|
--replace "funcsigs==1.0.0" "funcsigs" \
|
|
|
|
--replace "flask-swagger==0.2.13" "flask-swagger" \
|
|
|
|
--replace "python-daemon>=2.1.1, <2.2" "python-daemon" \
|
2020-07-02 04:25:12 +01:00
|
|
|
--replace "alembic>=1.0, <2.0" "alembic" \
|
2020-03-28 01:05:53 +00:00
|
|
|
--replace "markdown>=2.5.2, <3.0" "markdown" \
|
|
|
|
--replace "future>=0.16.0, <0.17" "future" \
|
|
|
|
--replace "tenacity==4.12.0" "tenacity" \
|
|
|
|
--replace "text-unidecode==1.2" "text-unidecode" \
|
|
|
|
--replace "tzlocal>=1.4,<2.0.0" "tzlocal" \
|
|
|
|
--replace "sqlalchemy~=1.3" "sqlalchemy" \
|
2020-07-02 04:25:12 +01:00
|
|
|
--replace "gunicorn>=19.5.0, <20.0" "gunicorn"
|
2019-11-15 21:14:25 +00:00
|
|
|
|
2020-03-28 01:05:53 +00:00
|
|
|
# dumb-init is only needed for CI and Docker, not relevant for NixOS.
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'dumb-init>=1.2.2'," ""
|
2020-02-13 07:09:20 +00:00
|
|
|
|
2020-03-28 01:05:53 +00:00
|
|
|
substituteInPlace tests/core.py \
|
|
|
|
--replace "/bin/bash" "${stdenv.shell}"
|
2019-07-18 14:18:26 +01:00
|
|
|
'';
|
|
|
|
|
2020-05-11 21:15:27 +01:00
|
|
|
# allow for gunicorn processes to have access to python packages
|
|
|
|
makeWrapperArgs = [ "--prefix PYTHONPATH : $PYTHONPATH" ];
|
|
|
|
|
2019-07-18 14:18:26 +01:00
|
|
|
checkPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
export AIRFLOW_HOME=$HOME
|
|
|
|
export AIRFLOW__CORE__UNIT_TEST_MODE=True
|
|
|
|
export AIRFLOW_DB="$HOME/airflow.db"
|
2019-07-19 02:09:16 +01:00
|
|
|
export PATH=$PATH:$out/bin
|
2019-07-18 14:18:26 +01:00
|
|
|
|
2019-07-19 02:09:16 +01:00
|
|
|
airflow version
|
|
|
|
airflow initdb
|
|
|
|
airflow resetdb -y
|
|
|
|
nosetests tests.core.CoreTest
|
|
|
|
## all tests
|
|
|
|
# nosetests --cover-package=airflow
|
2019-07-18 14:18:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Programmatically author, schedule and monitor data pipelines";
|
2020-03-28 01:05:53 +00:00
|
|
|
homepage = "http://airflow.apache.org/";
|
2019-07-18 14:18:26 +01:00
|
|
|
license = licenses.asl20;
|
2020-06-05 02:15:58 +01:00
|
|
|
maintainers = with maintainers; [ bhipple costrouc ingenieroariel ];
|
2019-07-18 14:18:26 +01:00
|
|
|
};
|
|
|
|
}
|