summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/aiohttp-cors/default.nix
blob: 083b1a513063b46a7de58a9614a5c6e6356f49bb (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,
  aiohttp,
  pytestCheckHook,
  pytest-aiohttp,
  setuptools,
}:

buildPythonPackage rec {
  pname = "aiohttp-cors";
  version = "0.8.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "aio-libs";
    repo = "aiohttp-cors";
    tag = "v${version}";
    hash = "sha256-AbMuUeCNM8+oZj/hutG3zxHOwYN8uZlLFBeYTlu1fh4=";
  };

  build-system = [ setuptools ];

  dependencies = [ aiohttp ];

  pythonImportsCheck = [ "aiohttp_cors" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-aiohttp
  ];

  disabledTests = [
    # async def functions are not natively supported and have been skipped.
    "test_main"
    "test_defaults"
    "test_raises_forbidden_when_config_not_found"
    "test_raises_when_handler_not_extend"
  ];

  # interactive browser tests using selenium
  disabledTestPaths = [ "tests/integration" ];

  meta = {
    changelog = "https://github.com/aio-libs/aiohttp-cors/blob/${src.tag}/CHANGES.rst";
    description = "CORS support for aiohttp";
    homepage = "https://github.com/aio-libs/aiohttp-cors";
    license = lib.licenses.asl20;
    maintainers = [ ];
  };
}