summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/aiohttp-utils/default.nix
blob: bfa03709b7a47c2223d1856be98447964c4976e8 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,
  setuptools,
  aiohttp,
  python-mimeparse,
  gunicorn,
  mako,
  pytestCheckHook,
  webtest-aiohttp,
}:

buildPythonPackage (finalAttrs: {
  pname = "aiohttp-utils";
  version = "3.2.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "sloria";
    repo = "aiohttp-utils";
    tag = finalAttrs.version;
    hash = "sha256-CGKka6nGQ9o4wn6o3YJ3hm8jGbg16NKkCdBA1mKz4bo=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    aiohttp
    python-mimeparse
    gunicorn
  ];

  pythonImportsCheck = [
    "aiohttp_utils"
  ];

  nativeCheckInputs = [
    mako
    pytestCheckHook
    webtest-aiohttp
  ];

  disabledTests = [
    # AssertionError: assert None == 'application/octet-stream'
    "test_renders_to_json_by_default"
  ];

  disabledTestPaths = lib.optionals (pythonAtLeast "3.14") [
    # RuntimeError: There is no current event loop in thread 'MainThread'.
    "tests/test_examples.py"
    "tests/test_negotiation.py"
    "tests/test_routing.py"
  ];

  meta = {
    description = "Handy utilities for building aiohttp.web applications";
    homepage = "https://github.com/sloria/aiohttp-utils";
    changelog = "https://github.com/sloria/aiohttp-utils/tags/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
})