From 559d193f4e7c7bc8ac472f2ba44eb8902928a78a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 2 Jan 2022 11:28:42 +0100 Subject: [PATCH] python3Packages.url-normalize: switch to poetry-core, remove cov and flakes --- .../python-modules/url-normalize/default.nix | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/url-normalize/default.nix b/pkgs/development/python-modules/url-normalize/default.nix index ea7825d9ffd2..3032f7791a70 100644 --- a/pkgs/development/python-modules/url-normalize/default.nix +++ b/pkgs/development/python-modules/url-normalize/default.nix @@ -1,8 +1,8 @@ { lib , buildPythonPackage , fetchFromGitHub -, poetry -, pytest-cov +, fetchpatch +, poetry-core , pytest-flakes , pytest-mock , pytest-socket @@ -19,22 +19,41 @@ buildPythonPackage rec { owner = "niksite"; repo = pname; rev = version; - sha256 = "09nac5nh94x0n4bfazjfxk96b20mfsx6r1fnvqv85gkzs0rwqkaq"; + hash = "sha256-WE3MM9B/voI23taFbLp2FYhl0uxOfuUWsaCTBG1hyiY="; }; - nativeBuildInputs = [ poetry ]; + nativeBuildInputs = [ + poetry-core + ]; - propagatedBuildInputs = [ six ]; + propagatedBuildInputs = [ + six + ]; checkInputs = [ - pytest-cov pytest-flakes pytest-mock pytest-socket pytestCheckHook ]; - pythonImportsCheck = [ "url_normalize" ]; + patches = [ + # Switch to poetry-core, https://github.com/niksite/url-normalize/pull/28 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/niksite/url-normalize/commit/b8557b10c977b191cc9d37e6337afe874a24ad08.patch"; + sha256 = "sha256-SVCQATV9V6HbLmjOHs7V7eBagO0PuqZLubIJghBYfQQ="; + }) + ]; + + postPatch = '' + sed -i "/--cov/d" tox.ini + sed -i "/--flakes/d" tox.ini + ''; + + pythonImportsCheck = [ + "url_normalize" + ]; meta = with lib; { description = "URL normalization for Python";