summary refs log tree commit diff
path: root/pkgs/development/python-modules/sanic-auth/default.nix
blob: 813df37a84e58f0d827eb2cfae8a402b55392111 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchPypi
, sanic
, sanic-testing
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "Sanic-Auth";
  version = "0.3.0";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0dc24ynqjraqwgvyk0g9bj87zgpq4xnssl24hnsn7l5vlkmk8198";
  };

  propagatedBuildInputs = [
    sanic
  ];

  nativeCheckInputs = [
    pytestCheckHook
    sanic-testing
  ];

  disabledTests = [
    # incompatible with sanic>=22.3.0
    "test_login_required"
  ];

  postPatch = ''
    # Support for httpx>=0.20.0
    substituteInPlace tests/test_auth.py \
      --replace "allow_redirects=False" "follow_redirects=False"
  '';

  pythonImportsCheck = [
    "sanic_auth"
  ];

  meta = with lib; {
    description = "Simple Authentication for Sanic";
    homepage = "https://github.com/pyx/sanic-auth/";
    license = licenses.bsdOriginal;
    maintainers = with maintainers; [ arnoldfarkas ];
  };
}