Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.apache-airflow init 1.10.5 #73074

Merged
merged 20 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions pkgs/development/python-modules/apache-airflow/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, fetchpatch
, alembic
, cached-property
, configparser
, colorlog
, croniter
, dill
, flask
, flask-appbuilder
, flask-admin
, flask-caching
, flask_login
, flask-swagger
, flask_wtf
, flask-bcrypt
, funcsigs
, future
, GitPython
, gunicorn
, iso8601
, json-merge-patch
, jinja2
, ldap3
, lxml
, lazy-object-proxy
, markdown
, pandas
, pendulum
, psutil
, pygments
, python-daemon
, python-dateutil
, requests
, setproctitle
, snakebite
, sqlalchemy
, tabulate
, tenacity
, termcolor
, text-unidecode
, thrift
, tzlocal
, unicodecsv
, werkzeug
, zope_deprecation
, enum34
, typing
, nose
, python
, isPy3k
}:

buildPythonPackage rec {
pname = "apache-airflow";
version = "1.10.5";
disabled = (!isPy3k);

src = fetchFromGitHub rec {
owner = "apache";
repo = "airflow";
rev = version;
sha256 = "14fmhfwx977c9jdb2kgm93i6acx43l45ggj30rb37r68pzpb6l6h";
};

patches = [
# Not yet accepted: https://github.com/apache/airflow/pull/6562
(fetchpatch {
name = "avoid-warning-from-abc.collections";
url = https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6562.patch;
sha256 = "0swpay1qlb7f9kgc56631s1qd9k82w4nw2ggvkm7jvxwf056k61z";
})
# Not yet accepted: https://github.com/apache/airflow/pull/6561
(fetchpatch {
jonringer marked this conversation as resolved.
Show resolved Hide resolved
name = "pendulum2-compatibility";
url = https://patch-diff.githubusercontent.com/raw/apache/airflow/pull/6561.patch;
sha256 = "17hw8qyd4zxvib9zwpbn32p99vmrdz294r31gnsbkkcl2y6h9knk";
})
];

propagatedBuildInputs = [
alembic
cached-property
colorlog
configparser
croniter
dill
flask
flask-admin
flask-appbuilder
flask-bcrypt
flask-caching
flask_login
flask-swagger
flask_wtf
funcsigs
future
GitPython
gunicorn
iso8601
json-merge-patch
jinja2
ldap3
lxml
lazy-object-proxy
markdown
pandas
pendulum
psutil
pygments
python-daemon
python-dateutil
requests
setproctitle
sqlalchemy
tabulate
tenacity
termcolor
text-unidecode
thrift
tzlocal
unicodecsv
werkzeug
zope_deprecation
];

checkInputs = [
snakebite
nose
];

postPatch = ''

substituteInPlace setup.py \
--replace "flask>=1.1.0, <2.0" "flask" \
--replace "flask-caching>=1.3.3, <1.4.0" "flask-caching" \
--replace "flask-appbuilder>=1.12.5, <2.0.0" "flask-appbuilder" \
--replace "pendulum==1.4.4" "pendulum" \
--replace "cached_property~=1.5" "cached_property" \
--replace "dill>=0.2.2, <0.3" "dill" \
--replace "configparser>=3.5.0, <3.6.0" "configparser" \
--replace "jinja2>=2.7.3, <=2.10.0" "jinja2" \
--replace "funcsigs==1.0.0" "funcsigs" \
--replace "flask-swagger==0.2.13" "flask-swagger" \
--replace "python-daemon>=2.1.1, <2.2" "python-daemon" \
--replace "alembic>=0.9, <1.0" "alembic" \
--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" \
--replace "werkzeug>=0.14.1, <0.15.0" "werkzeug"

# dumb-init is only needed for CI and Docker, not relevant for NixOS.
substituteInPlace setup.py \
--replace "'dumb-init>=1.2.2'," ""

substituteInPlace tests/core.py \
--replace "/bin/bash" "${stdenv.shell}"
'';

checkPhase = ''
export HOME=$(mktemp -d)
export AIRFLOW_HOME=$HOME
export AIRFLOW__CORE__UNIT_TEST_MODE=True
export AIRFLOW_DB="$HOME/airflow.db"
export PATH=$PATH:$out/bin

airflow version
airflow initdb
airflow resetdb -y
nosetests tests.core.CoreTest
## all tests
# nosetests --cover-package=airflow
'';

meta = with lib; {
description = "Programmatically author, schedule and monitor data pipelines";
homepage = http://airflow.apache.org/;
license = licenses.asl20;
maintainers = [ maintainers.costrouc maintainers.ingenieroariel ];
};
}
36 changes: 36 additions & 0 deletions pkgs/development/python-modules/apispec/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ lib
, buildPythonPackage
, fetchPypi
, pyyaml
, prance
, marshmallow
, pytestCheckHook
, mock
, openapi-spec-validator
}:

buildPythonPackage rec {
pname = "apispec";
version = "3.1.0";

src = fetchPypi {
inherit pname version;
sha256 = "0rr32z9hbf8w4w1fs5gj2v0ixcq2vq7a3wssrlxagi5ii7ygap7y";
};

checkInputs = [
pyyaml
prance
openapi-spec-validator
marshmallow
mock
pytestCheckHook
];

meta = with lib; {
description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification";
homepage = https://github.com/marshmallow-code/apispec;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
jonringer marked this conversation as resolved.
Show resolved Hide resolved
};
}
37 changes: 37 additions & 0 deletions pkgs/development/python-modules/croniter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ lib
, buildPythonPackage
, fetchPypi
, python-dateutil
, pytest
, pytz
}:

buildPythonPackage rec {
pname = "croniter";
version = "0.3.30";

src = fetchPypi {
inherit pname version;
sha256 = "538adeb3a7f7816c3cdec6db974c441620d764c25ff4ed0146ee7296b8a50590";
};

propagatedBuildInputs = [
python-dateutil
];

checkInputs = [
pytest
pytz
];

checkPhase = ''
pytest src/croniter
'';

meta = with lib; {
description = "croniter provides iteration for datetime object with cron like format";
homepage = http://github.com/kiorky/croniter;
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}
71 changes: 71 additions & 0 deletions pkgs/development/python-modules/flask-admin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
, pillow
, mongoengine
, pymongo
, wtf-peewee
, sqlalchemy
, sqlalchemy-citext
, flask-mongoengine
, flask_sqlalchemy
, flask-babelex
, shapely
, geoalchemy2
, psycopg2
, flask
, wtforms
, isPy27
, enum34
}:

buildPythonPackage rec {
pname = "flask-admin";
version = "1.5.3";

src = fetchPypi {
pname = "Flask-Admin";
inherit version;
sha256 = "ca0be6ec11a6913b73f656c65c444ae5be416c57c75638dd3199376ce6bc7422";
};

checkInputs = [
nose
pillow
mongoengine
pymongo
wtf-peewee
sqlalchemy
sqlalchemy-citext
flask-mongoengine
flask_sqlalchemy
flask-babelex
shapely
geoalchemy2
psycopg2
];

propagatedBuildInputs = [
flask
wtforms
] ++ lib.optionals isPy27 [ enum34 ];

checkPhase = ''
# disable tests that require mongodb, postresql
nosetests \
-e "mongoengine" \
-e "pymongo" \
-e "test_form_upload" \
-e "test_postgres" \
-e "geoa" \
flask_admin/tests
'';

meta = with lib; {
description = "Simple and extensible admin interface framework for Flask";
homepage = https://github.com/flask-admin/flask-admin/;
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}
Loading