Unverified Commit 31bfa34a authored by TomaSajt's avatar TomaSajt
Browse files

python312Packages.pybrowserid: fix tests, refactor

parent b5948e16
Loading
Loading
Loading
Loading
+27 −7
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchPypi
, requests, mock }:
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  requests,
  unittestCheckHook,
  mock,
}:

buildPythonPackage rec {
  pname = "pybrowserid";
  version = "0.14.0";
  pyproject = true;

  src = fetchPypi {
    pname = "PyBrowserID";
    inherit version;
    sha256 = "1qvi79kfb8x9kxkm5lw2mp42hm82cpps1xknmsb5ghkwx1lpc8kc";
    hash = "sha256-bCJ2aeh8wleWrnb2oO9lAlUoyK2C01Jnn6mj5WY6ceM=";
  };

  propagatedBuildInputs = [ requests ];
  postPatch = ''
    substituteInPlace browserid/tests/* \
        --replace-warn 'assertEquals' 'assertEqual'
  '';

  nativeCheckInputs = [ mock ];
  build-system = [ setuptools ];

  dependencies = [ requests ];

  pythonImportsCheck = [ "browserid" ];

  nativeCheckInputs = [
    unittestCheckHook
    mock
  ];

  meta = with lib; {
    description = "Python library for the BrowserID Protocol";