From e061d3e939d4b5b66b62fae4f19ab8278d9c6b15 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 17:27:51 +0200 Subject: [PATCH] python312Packages.python-etcd: 0.4.5 -> 0.5.0-unstable-2023-10-31; drop nose --- .../python-modules/python-etcd/default.nix | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/python-etcd/default.nix b/pkgs/development/python-modules/python-etcd/default.nix index b9dcd8aaee39..05fe0b86069d 100644 --- a/pkgs/development/python-modules/python-etcd/default.nix +++ b/pkgs/development/python-modules/python-etcd/default.nix @@ -1,41 +1,48 @@ { lib, buildPythonPackage, - fetchPypi, - nose, - mock, - pyopenssl, + fetchFromGitHub, + setuptools, urllib3, dnspython, + pytestCheckHook, + etcd_3_4, + mock, + pyopenssl, }: -buildPythonPackage rec { +buildPythonPackage { pname = "python-etcd"; - version = "0.4.5"; - format = "setuptools"; + version = "0.5.0-unstable-2023-10-31"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "f1b5ebb825a3e8190494f5ce1509fde9069f2754838ed90402a8c11e1f52b8cb"; + src = fetchFromGitHub { + owner = "jplana"; + repo = "python-etcd"; + rev = "5aea0fd4461bd05dd96e4ad637f6be7bceb1cee5"; + hash = "sha256-eVirStLOPTbf860jfkNMWtGf+r0VygLZRjRDjBMCVKg="; }; - buildInputs = [ - nose - mock - pyopenssl - ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ urllib3 dnspython ]; - postPatch = '' - sed -i '19s/dns/"dnspython"/' setup.py - ''; + nativeCheckInputs = [ + pytestCheckHook + etcd_3_4 + mock + pyopenssl + ]; - # Some issues with etcd not in path even though most tests passed - doCheck = false; + preCheck = '' + for file in "test_auth" "integration/test_simple"; do + substituteInPlace src/etcd/tests/$file.py \ + --replace-fail "assertEquals" "assertEqual" + done + ''; meta = with lib; { description = "Python client for Etcd";