Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 193 lines 4.4 kB view raw
1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, fetchFromGitHub 6, fetchpatch 7, alembic 8, cached-property 9, configparser 10, colorlog 11, croniter 12, dill 13, flask 14, flask-appbuilder 15, flask-admin 16, flask-caching 17, flask_login 18, flask-swagger 19, flask_wtf 20, flask-bcrypt 21, funcsigs 22, future 23, GitPython 24, gunicorn 25, iso8601 26, json-merge-patch 27, jinja2 28, ldap3 29, lxml 30, lazy-object-proxy 31, markdown 32, pandas 33, pendulum 34, psutil 35, pygments 36, python-daemon 37, python-dateutil 38, requests 39, setproctitle 40, snakebite 41, sqlalchemy 42, tabulate 43, tenacity 44, termcolor 45, text-unidecode 46, thrift 47, tzlocal 48, unicodecsv 49, werkzeug 50, zope_deprecation 51, enum34 52, typing 53, nose 54, python 55, isPy3k 56, isPy38 57}: 58 59buildPythonPackage rec { 60 pname = "apache-airflow"; 61 version = "1.10.5"; 62 disabled = (!isPy3k); 63 64 src = fetchFromGitHub rec { 65 owner = "apache"; 66 repo = "airflow"; 67 rev = version; 68 sha256 = "14fmhfwx977c9jdb2kgm93i6acx43l45ggj30rb37r68pzpb6l6h"; 69 }; 70 71 patches = [ 72 # Not yet accepted: https://github.com/apache/airflow/pull/6562 73 (fetchpatch { 74 name = "avoid-warning-from-abc.collections"; 75 url = https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6562.patch; 76 sha256 = "0swpay1qlb7f9kgc56631s1qd9k82w4nw2ggvkm7jvxwf056k61z"; 77 }) 78 # Not yet accepted: https://github.com/apache/airflow/pull/6561 79 (fetchpatch { 80 name = "pendulum2-compatibility"; 81 url = https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6561.patch; 82 sha256 = "17hw8qyd4zxvib9zwpbn32p99vmrdz294r31gnsbkkcl2y6h9knk"; 83 }) 84 ]; 85 86 propagatedBuildInputs = [ 87 alembic 88 cached-property 89 colorlog 90 configparser 91 croniter 92 dill 93 flask 94 flask-admin 95 flask-appbuilder 96 flask-bcrypt 97 flask-caching 98 flask_login 99 flask-swagger 100 flask_wtf 101 funcsigs 102 future 103 GitPython 104 gunicorn 105 iso8601 106 json-merge-patch 107 jinja2 108 ldap3 109 lxml 110 lazy-object-proxy 111 markdown 112 pandas 113 pendulum 114 psutil 115 pygments 116 python-daemon 117 python-dateutil 118 requests 119 setproctitle 120 sqlalchemy 121 tabulate 122 tenacity 123 termcolor 124 text-unidecode 125 thrift 126 tzlocal 127 unicodecsv 128 werkzeug 129 zope_deprecation 130 ]; 131 132 checkInputs = [ 133 snakebite 134 nose 135 ]; 136 137 postPatch = '' 138 139 substituteInPlace setup.py \ 140 --replace "flask>=1.1.0, <2.0" "flask" \ 141 --replace "jinja2>=2.10.1, <2.11.0" "jinja2" \ 142 --replace "pandas>=0.17.1, <1.0.0" "pandas" \ 143 --replace "flask-caching>=1.3.3, <1.4.0" "flask-caching" \ 144 --replace "flask-appbuilder>=1.12.5, <2.0.0" "flask-appbuilder" \ 145 --replace "pendulum==1.4.4" "pendulum" \ 146 --replace "cached_property~=1.5" "cached_property" \ 147 --replace "dill>=0.2.2, <0.3" "dill" \ 148 --replace "configparser>=3.5.0, <3.6.0" "configparser" \ 149 --replace "jinja2>=2.7.3, <=2.10.0" "jinja2" \ 150 --replace "funcsigs==1.0.0" "funcsigs" \ 151 --replace "flask-swagger==0.2.13" "flask-swagger" \ 152 --replace "python-daemon>=2.1.1, <2.2" "python-daemon" \ 153 --replace "alembic>=0.9, <1.0" "alembic" \ 154 --replace "markdown>=2.5.2, <3.0" "markdown" \ 155 --replace "future>=0.16.0, <0.17" "future" \ 156 --replace "tenacity==4.12.0" "tenacity" \ 157 --replace "text-unidecode==1.2" "text-unidecode" \ 158 --replace "tzlocal>=1.4,<2.0.0" "tzlocal" \ 159 --replace "sqlalchemy~=1.3" "sqlalchemy" \ 160 --replace "gunicorn>=19.5.0, <20.0" "gunicorn" \ 161 --replace "werkzeug>=0.14.1, <0.15.0" "werkzeug" 162 163 # dumb-init is only needed for CI and Docker, not relevant for NixOS. 164 substituteInPlace setup.py \ 165 --replace "'dumb-init>=1.2.2'," "" 166 167 substituteInPlace tests/core.py \ 168 --replace "/bin/bash" "${stdenv.shell}" 169 ''; 170 171 checkPhase = '' 172 export HOME=$(mktemp -d) 173 export AIRFLOW_HOME=$HOME 174 export AIRFLOW__CORE__UNIT_TEST_MODE=True 175 export AIRFLOW_DB="$HOME/airflow.db" 176 export PATH=$PATH:$out/bin 177 178 airflow version 179 airflow initdb 180 airflow resetdb -y 181 nosetests tests.core.CoreTest 182 ## all tests 183 # nosetests --cover-package=airflow 184 ''; 185 186 meta = with lib; { 187 description = "Programmatically author, schedule and monitor data pipelines"; 188 homepage = http://airflow.apache.org/; 189 license = licenses.asl20; 190 maintainers = [ maintainers.costrouc maintainers.ingenieroariel ]; 191 broken = isPy38; 192 }; 193}