Unverified Commit b5948e16 authored by TomaSajt's avatar TomaSajt
Browse files

python312Packages.hawkauthlib: fix tests, refactor

parent 9f7053ff
Loading
Loading
Loading
Loading
+27 −10
Original line number Diff line number Diff line
{ 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; [ ];
  };

}