Merge pull request #146715 from smancill/ZHF-apache-airflow
apache-airflow: fix build on darwin
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
, termcolor
|
||||
, unicodecsv
|
||||
, werkzeug
|
||||
, pytest
|
||||
, pytestCheckHook
|
||||
, freezegun
|
||||
, mkYarnPackage
|
||||
}:
|
||||
@@ -171,7 +171,7 @@ buildPythonPackage rec {
|
||||
|
||||
checkInputs = [
|
||||
freezegun
|
||||
pytest
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
INSTALL_PROVIDERS_FROM_SOURCES = "true";
|
||||
@@ -199,12 +199,16 @@ buildPythonPackage rec {
|
||||
|
||||
substituteInPlace tests/core/test_core.py \
|
||||
--replace "/bin/bash" "${stdenv.shell}"
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
# Fix failing test on Hydra
|
||||
substituteInPlace airflow/utils/db.py \
|
||||
--replace "/tmp/sqlite_default.db" "$TMPDIR/sqlite_default.db"
|
||||
'';
|
||||
|
||||
# allow for gunicorn processes to have access to python packages
|
||||
makeWrapperArgs = [ "--prefix PYTHONPATH : $PYTHONPATH" ];
|
||||
|
||||
checkPhase = ''
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
export AIRFLOW_HOME=$HOME
|
||||
export AIRFLOW__CORE__UNIT_TEST_MODE=True
|
||||
@@ -214,10 +218,16 @@ buildPythonPackage rec {
|
||||
airflow version
|
||||
airflow db init
|
||||
airflow db reset -y
|
||||
|
||||
pytest tests/core/test_core.py
|
||||
'';
|
||||
|
||||
pytestFlagsArray = [
|
||||
"tests/core/test_core.py"
|
||||
];
|
||||
|
||||
disabledTests = lib.optionals stdenv.isDarwin [
|
||||
"bash_operator_kill" # psutil.AccessDenied
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user