summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/aiosasl/default.nix
blob: 95f5ed8e7470c3703d7ec64cadd25bd83a0a5aa0 (plain)
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
50
51
52
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  pyopenssl,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "aiosasl";
  version = "0.5.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "horazont";
    repo = "aiosasl";
    tag = "v${version}";
    hash = "sha256-JIuNPb/l4QURMQc905H2iNGCfMz+zM/QJhDQOR8LPdc=";
  };

  patches = [
    (fetchpatch {
      name = "python311-compat.patch";
      url = "https://github.com/horazont/aiosasl/commit/44c48d36b416bd635d970dba2607a31b2167ea1b.patch";
      hash = "sha256-u6PJKV54dU2MA9hXa/9hJ3eLVds1DuLHGbt8y/OakWs=";
    })
  ];

  postPatch = ''
    # https://github.com/horazont/aiosasl/issues/28
    substituteInPlace tests/test_aiosasl.py \
      --replace-fail "assertRaisesRegexp" "assertRaisesRegex"
  '';

  build-system = [ setuptools ];

  nativeCheckInputs = [
    pyopenssl
    pytestCheckHook
  ];

  pythonImportsCheck = [ "aiosasl" ];

  meta = {
    description = "Asyncio SASL library";
    homepage = "https://github.com/horazont/aiosasl";
    license = lib.licenses.lgpl3Plus;
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}