From 9318bf784c7c66a85adb915885032ce8814adce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 10 Aug 2024 12:57:03 -0700 Subject: [PATCH 1/2] mealie: modernize --- pkgs/by-name/me/mealie/package.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/me/mealie/package.nix b/pkgs/by-name/me/mealie/package.nix index 16f9379dfb74..9151f4bac2dc 100644 --- a/pkgs/by-name/me/mealie/package.nix +++ b/pkgs/by-name/me/mealie/package.nix @@ -41,22 +41,21 @@ let }; in -pythonpkgs.buildPythonPackage rec { +pythonpkgs.buildPythonApplication rec { pname = "mealie"; inherit version src; pyproject = true; - nativeBuildInputs = [ - pythonpkgs.poetry-core - makeWrapper - ]; + build-system = with pythonpkgs; [ poetry-core ]; + + nativeBuildInputs = [ makeWrapper ]; dontWrapPythonPrograms = true; doCheck = false; pythonRelaxDeps = true; - propagatedBuildInputs = with pythonpkgs; [ + dependencies = with pythonpkgs; [ aiofiles alembic aniso8601 @@ -121,19 +120,17 @@ pythonpkgs.buildPythonPackage rec { --replace-fail 'script_location = alembic' 'script_location = ${src}/alembic' makeWrapper ${start_script} $out/bin/mealie \ - --set PYTHONPATH "$out/${python.sitePackages}:${python.pkgs.makePythonPath propagatedBuildInputs}" \ + --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ --set LD_LIBRARY_PATH "${crfpp}/lib" \ --set STATIC_FILES "${frontend}" \ --set PATH "${lib.makeBinPath [ crfpp ]}" makeWrapper ${init_db} $out/libexec/init_db \ - --set PYTHONPATH "$out/${python.sitePackages}:${python.pkgs.makePythonPath propagatedBuildInputs}" \ + --set PYTHONPATH "$out/${python.sitePackages}:${pythonpkgs.makePythonPath dependencies}" \ --set OUT "$out" ''; - checkInputs = with python.pkgs; [ - pytestCheckHook - ]; + nativeCheckInputs = with pythonpkgs; [ pytestCheckHook ]; passthru.tests = { inherit (nixosTests) mealie; From c7caf3faca1500072f56268cef216631035a4fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 10 Aug 2024 13:22:44 -0700 Subject: [PATCH 2/2] mealie: run tests --- pkgs/by-name/me/mealie/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/me/mealie/package.nix b/pkgs/by-name/me/mealie/package.nix index 9151f4bac2dc..13d8db1e5502 100644 --- a/pkgs/by-name/me/mealie/package.nix +++ b/pkgs/by-name/me/mealie/package.nix @@ -52,7 +52,6 @@ pythonpkgs.buildPythonApplication rec { dontWrapPythonPrograms = true; - doCheck = false; pythonRelaxDeps = true; dependencies = with pythonpkgs; [ @@ -132,6 +131,16 @@ pythonpkgs.buildPythonApplication rec { nativeCheckInputs = with pythonpkgs; [ pytestCheckHook ]; + disabledTestPaths = [ + # KeyError: 'alembic_version' + "tests/unit_tests/services_tests/backup_v2_tests/test_backup_v2.py" + "tests/unit_tests/services_tests/backup_v2_tests/test_alchemy_exporter.py" + # sqlite3.OperationalError: no such table + "tests/unit_tests/services_tests/scheduler/tasks/test_create_timeline_events.py" + "tests/unit_tests/test_ingredient_parser.py" + "tests/unit_tests/test_security.py" + ]; + passthru.tests = { inherit (nixosTests) mealie; };