apache-airflow: refactor add as python application

This commit is contained in:
Chris Ostrouchov 2019-07-18 21:09:16 -04:00 committed by Ariel
parent 20e87c1c8c
commit d6fdec8d24
2 changed files with 25 additions and 9 deletions

View File

@ -1,6 +1,8 @@
{ lib { lib
, stdenv
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchPypi
, fetchFromGitHub
, alembic , alembic
, configparser , configparser
, croniter , croniter
@ -12,6 +14,7 @@
, flask_login , flask_login
, flask-swagger , flask-swagger
, flask_wtf , flask_wtf
, flask-bcrypt
, funcsigs , funcsigs
, future , future
, GitPython , GitPython
@ -19,6 +22,7 @@
, iso8601 , iso8601
, json-merge-patch , json-merge-patch
, jinja2 , jinja2
, ldap3
, lxml , lxml
, markdown , markdown
, pandas , pandas
@ -29,6 +33,7 @@
, python-dateutil , python-dateutil
, requests , requests
, setproctitle , setproctitle
, snakebite
, sqlalchemy , sqlalchemy
, tabulate , tabulate
, tenacity , tenacity
@ -78,9 +83,11 @@ buildPythonPackage rec {
version = "1.10.3"; version = "1.10.3";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "apache";
sha256 = "73840fa3d2f3a523010ce685aa15714d01a4cf42bd6bd77716c4321f82bab140"; repo = "airflow";
rev = version;
sha256 = "040d1wbkcapkgb220yzk2dicnghhynj24m2xlbmqg6j54f007j94";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -91,6 +98,7 @@ buildPythonPackage rec {
flask flask
flask-appbuilder1 flask-appbuilder1
flask-admin flask-admin
flask-bcrypt
flask-caching flask-caching
flask_login flask_login
flask-swagger flask-swagger
@ -102,6 +110,7 @@ buildPythonPackage rec {
iso8601 iso8601
json-merge-patch json-merge-patch
jinja2 jinja2
ldap3
lxml lxml
markdown markdown
pandas pandas
@ -124,6 +133,7 @@ buildPythonPackage rec {
] ++ lib.optionals isPy27 [ enum34 typing ]; ] ++ lib.optionals isPy27 [ enum34 typing ];
checkInputs = [ checkInputs = [
snakebite
nose nose
]; ];
@ -142,6 +152,9 @@ buildPythonPackage rec {
--replace "future>=0.16.0, <0.17" "future" \ --replace "future>=0.16.0, <0.17" "future" \
--replace "tenacity==4.12.0" "tenacity" \ --replace "tenacity==4.12.0" "tenacity" \
--replace "werkzeug>=0.14.1, <0.15.0" "werkzeug" --replace "werkzeug>=0.14.1, <0.15.0" "werkzeug"
substituteInPlace tests/core.py \
--replace "/bin/bash" "${stdenv.shell}"
''; '';
checkPhase = '' checkPhase = ''
@ -149,15 +162,16 @@ buildPythonPackage rec {
export AIRFLOW_HOME=$HOME export AIRFLOW_HOME=$HOME
export AIRFLOW__CORE__UNIT_TEST_MODE=True export AIRFLOW__CORE__UNIT_TEST_MODE=True
export AIRFLOW_DB="$HOME/airflow.db" export AIRFLOW_DB="$HOME/airflow.db"
export PATH=$PATH:$out/bin
$out/bin/airflow initdb airflow version
$out/bin/airflow resetdb airflow initdb
nosetests --cover-package=airflow airflow resetdb -y
nosetests tests.core.CoreTest
## all tests
# nosetests --cover-package=airflow
''; '';
# tests are extremely complex to run
doCheck = false;
meta = with lib; { meta = with lib; {
description = "Programmatically author, schedule and monitor data pipelines"; description = "Programmatically author, schedule and monitor data pipelines";
homepage = http://airflow.apache.org/; homepage = http://airflow.apache.org/;

View File

@ -559,6 +559,8 @@ in
airfield = callPackage ../tools/networking/airfield { }; airfield = callPackage ../tools/networking/airfield { };
apache-airflow = with python3.pkgs; toPythonApplication apache-airflow;
airsonic = callPackage ../servers/misc/airsonic { }; airsonic = callPackage ../servers/misc/airsonic { };
airspy = callPackage ../applications/radio/airspy { }; airspy = callPackage ../applications/radio/airspy { };