From a399f8d5582a94d5ad8210a220bf5f7329da1b2c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Dec 2024 05:15:13 +0100 Subject: [PATCH 1/2] python312Packages.zamg: refactor --- pkgs/development/python-modules/zamg/default.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/zamg/default.nix b/pkgs/development/python-modules/zamg/default.nix index e057433c1789..0902bf080700 100644 --- a/pkgs/development/python-modules/zamg/default.nix +++ b/pkgs/development/python-modules/zamg/default.nix @@ -21,14 +21,9 @@ buildPythonPackage rec { hash = "sha256-j864+3c0GDDftdLqLDD0hizT54c0IgTjT77jOneXlq0="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov" "" - ''; + build-system = [ poetry-core ]; - nativeBuildInputs = [ poetry-core ]; - - propagatedBuildInputs = [ aiohttp ]; + dependencies = [ aiohttp ]; # Module has no tests doCheck = false; @@ -39,7 +34,7 @@ buildPythonPackage rec { description = "Library to read weather data from ZAMG Austria"; homepage = "https://github.com/killer0071234/python-zamg"; changelog = "https://github.com/killer0071234/python-zamg/releases/tag/v${version}"; - license = with licenses; [ mit ]; + license = licenses.mit; maintainers = with maintainers; [ fab ]; }; } From 31b74a2bb3c6d1939d4d53c576498381ddd9646b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Dec 2024 05:19:14 +0100 Subject: [PATCH 2/2] python312Packages.zamg: enable tests --- .../python-modules/zamg/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/zamg/default.nix b/pkgs/development/python-modules/zamg/default.nix index 0902bf080700..1d87e72268f8 100644 --- a/pkgs/development/python-modules/zamg/default.nix +++ b/pkgs/development/python-modules/zamg/default.nix @@ -1,9 +1,13 @@ { lib, aiohttp, + aresponses, buildPythonPackage, fetchFromGitHub, poetry-core, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, pythonOlder, }: @@ -25,11 +29,21 @@ buildPythonPackage rec { dependencies = [ aiohttp ]; - # Module has no tests - doCheck = false; + nativeCheckInputs = [ + aresponses + pytest-asyncio + pytest-cov-stub + pytestCheckHook + ]; pythonImportsCheck = [ "zamg" ]; + disabledTests = [ + # Tests are outdated + "test_update_fail_3" + "test_properties_fail_2" + ]; + meta = with lib; { description = "Library to read weather data from ZAMG Austria"; homepage = "https://github.com/killer0071234/python-zamg";