summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiocontextvars/default.nix
blob: 728f2b5fa61ad9ccdd3a5fed49a3e474529b7382 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestrunner
, pytest
, pytest-asyncio
, contextvars
, sqlalchemy
, isPy27
, pythonOlder
}:

buildPythonPackage rec {
  pname = "aiocontextvars";
  version = "0.2.2";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "fantix";
    repo = pname;
    rev = "v${version}";
    sha256 = "0a2gmrm9csiknc8n3si67sgzffkydplh9d7ga1k87ygk2aj22mmk";
  };

  buildInputs = [
    pytestrunner
  ];

  checkInputs = [
    pytest
    pytest-asyncio
  ];

  propagatedBuildInputs = [
    sqlalchemy
  ] ++ lib.optionals (pythonOlder "3.7") [ contextvars ];

  checkPhase = ''
    pytest
  '';

  meta = with lib; {
    description = "Asyncio support for PEP-567 contextvars backport";
    homepage = "https://github.com/fantix/aiocontextvars";
    license = licenses.bsd3;
    maintainers = [ maintainers.costrouc ];
  };
}