From b309fd081b0bc4c6c1d45d8b533f3ac76170b9f2 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Sun, 2 Feb 2025 21:30:17 +0100 Subject: [PATCH] python312Packages.enturclient: fix build, misc. cleanup --- .../python-modules/enturclient/default.nix | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/enturclient/default.nix b/pkgs/development/python-modules/enturclient/default.nix index 1b62fc88ef50..372bdf17e075 100644 --- a/pkgs/development/python-modules/enturclient/default.nix +++ b/pkgs/development/python-modules/enturclient/default.nix @@ -6,14 +6,15 @@ fetchFromGitHub, poetry-core, pythonOlder, + unittestCheckHook, }: buildPythonPackage rec { pname = "enturclient"; version = "0.2.4"; - disabled = pythonOlder "3.8"; + pyproject = true; - format = "pyproject"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "hfurubotten"; @@ -22,23 +23,27 @@ buildPythonPackage rec { hash = "sha256-Y2sBPikCAxumylP1LUy8XgjBRCWaNryn5XHSrRjJIIo="; }; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ aiohttp async-timeout ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'async_timeout = "^3.0.1"' 'async_timeout = ">=3.0.1"' - ''; - - # Project has no tests - doCheck = false; + pythonRelaxDeps = [ + "async_timeout" + ]; pythonImportsCheck = [ "enturclient" ]; + nativeCheckInputs = [ + unittestCheckHook + ]; + + unittestFlagsArray = [ + "tests/dto/" + ]; + meta = with lib; { description = "Python library for interacting with the Entur.org API"; homepage = "https://github.com/hfurubotten/enturclient";