From 42859902808def67ccd16ac45be36178c0678d6a Mon Sep 17 00:00:00 2001 From: Graham Bennett Date: Sat, 22 Oct 2022 11:10:50 +0100 Subject: [PATCH] apache-airflow: correctly run pytest checks Previously the whole checkPhase was overridden with the preparatory test setup commands, which prevented pytestCheckHook from having an effect. Fixed to do the preparatory work in preCheck. --- .../python-modules/apache-airflow/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/apache-airflow/default.nix b/pkgs/development/python-modules/apache-airflow/default.nix index 438dc46038cb..628cd7927311 100644 --- a/pkgs/development/python-modules/apache-airflow/default.nix +++ b/pkgs/development/python-modules/apache-airflow/default.nix @@ -238,12 +238,17 @@ buildPythonPackage rec { "--prefix PYTHONPATH : $PYTHONPATH" ]; + postInstall = '' + cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static + # Needed for pythonImportsCheck below + export HOME=$(mktemp -d) + ''; + pythonImportsCheck = [ "airflow" ] ++ providerImports; - checkPhase = '' - export HOME=$(mktemp -d) + preCheck = '' export AIRFLOW_HOME=$HOME export AIRFLOW__CORE__UNIT_TEST_MODE=True export AIRFLOW_DB="$HOME/airflow.db" @@ -262,10 +267,6 @@ buildPythonPackage rec { "bash_operator_kill" # psutil.AccessDenied ]; - postInstall = '' - cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static - ''; - # Updates yarn.lock and package.json passthru.updateScript = writeScript "update.sh" '' #!/usr/bin/env nix-shell