From b5948e16fcf2fd48f00e267187d9d21ce2482d41 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sat, 11 May 2024 20:30:14 +0200 Subject: [PATCH] python312Packages.hawkauthlib: fix tests, refactor --- .../python-modules/hawkauthlib/default.nix | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/hawkauthlib/default.nix b/pkgs/development/python-modules/hawkauthlib/default.nix index 9df850b78829..b7c6c73820a2 100644 --- a/pkgs/development/python-modules/hawkauthlib/default.nix +++ b/pkgs/development/python-modules/hawkauthlib/default.nix @@ -1,28 +1,45 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, requests -, webob +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + requests, + webob, + unittestCheckHook, }: buildPythonPackage rec { pname = "hawkauthlib"; version = "0.1.1"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "mozilla-services"; - repo = pname; + repo = "hawkauthlib"; rev = "refs/tags/v${version}"; - sha256 = "0mr1mpx4j9q7sch9arwfvpysnpf2p7ijy7072wilxm8pnj0bwvsi"; + hash = "sha256-UW++gLQX1U4jFwccL+O5wl2r/d2OZ5Ug0wcnSfqtIVc="; }; - propagatedBuildInputs = [ requests webob ]; + postPatch = '' + substituteInPlace hawkauthlib/tests/* \ + --replace-warn 'assertEquals' 'assertEqual' + ''; + + build-system = [ setuptools ]; + + dependencies = [ + requests + webob + ]; + + pythonImportsCheck = [ "hawkauthlib" ]; + + nativeCheckInputs = [ unittestCheckHook ]; meta = with lib; { homepage = "https://github.com/mozilla-services/hawkauthlib"; description = "Hawk Access Authentication protocol"; license = licenses.mpl20; + maintainers = with maintainers; [ ]; }; - }