apache-airflow: 1.10.3 -> 1.10.5, enable python

Includes misc fixes suggested during the PR process.
This commit is contained in:
Ariel 2019-11-15 16:14:25 -05:00
parent effe7f8a09
commit 7af3a955c9
10 changed files with 84 additions and 115 deletions

View File

@ -3,8 +3,11 @@
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, fetchpatch
, alembic
, cached-property
, configparser
, colorlog
, croniter
, dill
, flask
@ -24,6 +27,7 @@
, jinja2
, ldap3
, lxml
, lazy-object-proxy
, markdown
, pandas
, pendulum
@ -37,6 +41,7 @@
, sqlalchemy
, tabulate
, tenacity
, termcolor
, text-unidecode
, thrift
, tzlocal
@ -46,58 +51,47 @@
, enum34
, typing
, nose
, isPy27
, python
, isPy3k
}:
let # import error "from pendulum import Pendulum" due to 2.x
pendulum1 = pendulum.overrideAttrs (super: rec {
name = "pendulum-1.5.1";
src = fetchPypi {
pname = super.pname;
version = "1.5.1";
sha256 = "738878168eb26e5446da5d1f7b3312ae993a542061be8882099c00ef4866b1a2";
};
propagatedBuildInputs = super.propagatedBuildInputs ++ [ tzlocal ];
});
# 2.x has fstrings
flask-appbuilder1 = flask-appbuilder.overrideAttrs (super: rec {
name = "flask-appbuilder-1.13.0";
src = fetchPypi {
pname = "Flask-AppBuilder";
version = "1.13.0";
sha256 = "1bjcnklpycw62a02kilkdc48vk67sykvlp8l1bvqszkjxvvfhgvg";
};
buildPhase = ''
substituteInPlace setup.py \
--replace "prison==0.1.0" "prison"
'' + super.buildPhase;
});
in
buildPythonPackage rec {
pname = "apache-airflow";
version = "1.10.3";
version = "1.10.5";
disabled = (!isPy3k);
src = fetchFromGitHub {
src = fetchFromGitHub rec {
owner = "apache";
repo = "airflow";
rev = version;
sha256 = "040d1wbkcapkgb220yzk2dicnghhynj24m2xlbmqg6j54f007j94";
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 {
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-appbuilder1
flask-admin
flask-appbuilder
flask-bcrypt
flask-caching
flask_login
@ -112,9 +106,10 @@ buildPythonPackage rec {
jinja2
ldap3
lxml
lazy-object-proxy
markdown
pandas
pendulum1
pendulum
psutil
pygments
python-daemon
@ -124,13 +119,14 @@ buildPythonPackage rec {
sqlalchemy
tabulate
tenacity
termcolor
text-unidecode
thrift
tzlocal
unicodecsv
werkzeug
zope_deprecation
] ++ lib.optionals isPy27 [ enum34 typing ];
];
checkInputs = [
snakebite
@ -138,10 +134,14 @@ buildPythonPackage rec {
];
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.3" "flask-appbuilder" \
--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" \
@ -151,7 +151,14 @@ buildPythonPackage rec {
--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}"
@ -176,6 +183,6 @@ buildPythonPackage rec {
description = "Programmatically author, schedule and monitor data pipelines";
homepage = http://airflow.apache.org/;
license = licenses.asl20;
maintainers = [ maintainers.costrouc ];
maintainers = [ maintainers.costrouc maintainers.ingenieroariel ];
};
}

View File

@ -4,18 +4,18 @@
, pyyaml
, prance
, marshmallow
, pytest
, pytestCheckHook
, mock
, openapi-spec-validator
}:
buildPythonPackage rec {
pname = "apispec";
version = "2.0.2";
version = "3.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "11d1aaf620a80f67ded7688fcaf14fa4fd975d566876b5db69b067ffbfe4d1d9";
sha256 = "0rr32z9hbf8w4w1fs5gj2v0ixcq2vq7a3wssrlxagi5ii7ygap7y";
};
checkInputs = [
@ -23,14 +23,10 @@ buildPythonPackage rec {
prance
openapi-spec-validator
marshmallow
pytest
mock
pytestCheckHook
];
checkPhase = ''
pytest
'';
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;

View File

@ -53,12 +53,13 @@ buildPythonPackage rec {
checkPhase = ''
# disable tests that require mongodb, postresql
rm flask_admin/tests/mongoengine/test_basic.py
rm flask_admin/tests/pymongo/__init__.py
rm flask_admin/tests/test_form_upload.py
rm flask_admin/tests/sqla/test_postgres.py
rm flask_admin/tests/geoa/test_basic.py
nosetests flask_admin/tests
nosetests \
-e "mongoengine" \
-e "pymongo" \
-e "test_form_upload" \
-e "test_postgres" \
-e "geoa" \
flask_admin/tests
'';
meta = with lib; {

View File

@ -62,16 +62,12 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace setup.py \
--replace "jsonschema>=3.0.1<4" "jsonschema" \
--replace "marshmallow>=2.18.0,<2.20" "marshmallow" \
--replace "PyJWT>=1.7.1" "PyJWT" \
--replace "Flask-SQLAlchemy>=2.4,<3" "Flask-SQLAlchemy" \
--replace "Flask-JWT-Extended>=3.18,<4" "Flask-JWT-Extended"
'';
checkPhase = ''
# remove mockldap requirement
rm flask_appbuilder/tests/_test_ldapsearch.py
nosetests flask_appbuilder.api flask_appbuilder.tests.test_api
'';
# majority of tests require network access or mongo
doCheck = false;

View File

@ -30,6 +30,9 @@ buildPythonPackage rec {
];
checkPhase = ''
# Disabled 3 tests failing due to string representations of dates:
# Like "12. April 2010 um 15:46:00 MESZ" != 12. "April 2010 15:46:00 MESZ"
pytest tests/tests.py -k "not test_init_app \
and not test_custom_locale_selector \
and not test_basics"

View File

@ -3,13 +3,13 @@
, fetchPypi
, flask
, python3-openid
, python-openid
, isPy27
, isPy3k
}:
buildPythonPackage rec {
pname = "flask-openid";
version = "1.2.5";
disable = !isPy3k;
src = fetchPypi {
pname = "Flask-OpenID";
@ -19,7 +19,8 @@ buildPythonPackage rec {
propagatedBuildInputs = [
flask
] ++ (if isPy27 then [ python-openid ] else [ python3-openid ]);
python3-openid
];
# no tests for repo...
doCheck = false;

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
}:
buildPythonPackage rec {
@ -12,10 +13,15 @@ buildPythonPackage rec {
sha256 = "09898b6d427c08754e2a97c709cf2dfd7e28bd10c5683a538914975eab778d39";
};
postPatch = ''
substituteInPlace json_merge_patch/tests.py \
--replace "import lib as merge" "import json_merge_patch.lib as merge"
'';
patches = [
# This prevented tests from running (was using a relative import)
# https://github.com/OpenDataServices/json-merge-patch/pull/1
(fetchpatch {
name = "fully-qualified-json-merge-patch-import-on-tests";
url = https://patch-diff.githubusercontent.com/raw/OpenDataServices/json-merge-patch/pull/1.patch;
sha256 = "1k6xsrxsmz03nwcqsf4gf0zsfnl2r20n83npic8z6bqlpl4lidl4";
})
];
meta = with lib; {
description = "JSON Merge Patch library";

View File

@ -2,7 +2,7 @@
, buildPythonPackage
, fetchFromGitHub
, marshmallow
, pytest
, pytestCheckHook
, isPy27
, enum34
, pytest-flake8
@ -10,13 +10,13 @@
buildPythonPackage rec {
pname = "marshmallow-enum";
version = "1.4.1";
version = "1.5.1";
src = fetchFromGitHub {
owner = "justanr";
repo = "marshmallow_enum";
rev = "v${version}";
sha256 = "0ll65y8p0np6ayy8h8g5psf9xm7s0nclarxsh21fdsm72zscx356";
sha256 = "1ihrcmyfjabivg6hc44i59hnw5ijlg1byv3zs1rqxfynp8xr7398";
};
propagatedBuildInputs = [
@ -24,13 +24,14 @@ buildPythonPackage rec {
] ++ lib.optionals isPy27 [ enum34 ];
checkInputs = [
pytest
pytestCheckHook
pytest-flake8
];
checkPhase = ''
pytest tests
'';
disabledTests = [
"test_custom_error_in_deserialize_by_name"
"test_custom_error_in_deserialize_by_value"
];
meta = with lib; {
description = "Enum field for Marshmallow";

View File

@ -1,38 +0,0 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy27
, nose
}:
buildPythonPackage rec {
pname = "python-openid";
version = "2.2.5";
disabled = !isPy27;
src = fetchFromGitHub {
owner = "openid";
repo = pname;
rev = version;
sha256 = "198800ka2xyjz4yi2zm23l2a0knmqzxb4wj1nhqps70jz8mwg5mz";
};
checkInputs = [
nose
];
checkPhase = ''
nosetests
'';
# most tests require network access
doCheck = false;
meta = with lib; {
description = "OpenID support for servers and consumers";
homepage = https://github.com/openid/python-openid;
license = licenses.asl20;
maintainers = with maintainers; [ costrouc ];
};
}

View File

@ -1151,8 +1151,6 @@ in {
python3-openid = callPackage ../development/python-modules/python3-openid { };
python-openid = callPackage ../development/python-modules/python-openid { };
python-packer = callPackage ../development/python-modules/python-packer { };
python-periphery = callPackage ../development/python-modules/python-periphery { };
@ -3245,8 +3243,6 @@ in {
flask-mongoengine = callPackage ../development/python-modules/flask-mongoengine { };
flask_oauthlib = callPackage ../development/python-modules/flask-oauthlib { };
flask-openid = callPackage ../development/python-modules/flask-openid { };
flask-paginate = callPackage ../development/python-modules/flask-paginate { };