about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rpcq/default.nix
blob: 42643ca748261f1b0bc8b6db175d1f369b826108 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, buildPythonPackage
, fetchFromGitHub
, msgpack
, numpy
, pytest-asyncio
, pytestCheckHook
, python-rapidjson
, pythonOlder
, pyzmq
, ruamel-yaml
, setuptools
}:

buildPythonPackage rec {
  pname = "rpcq";
  version = "3.10.0";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "rigetti";
    repo = "rpcq";
    rev = "refs/tags/v${version}";
    hash = "sha256-J7jtGXJIF3jp0a0IQZmSR4TWf9D02Luau+Bupmi/d68=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "msgpack>=0.6,<1.0" "msgpack"
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    msgpack
    python-rapidjson
    pyzmq
    ruamel-yaml
  ];

  nativeCheckInputs = [
    numpy
    pytest-asyncio
    pytestCheckHook
  ];

  pytestFlagsArray = [
    # Don't run tests that spin-up a zmq server
    "rpcq/test/test_base.py"
    "rpcq/test/test_spec.py"
  ];

  pythonImportsCheck = [
    "rpcq"
  ];

  meta = with lib; {
    description = "The RPC framework and message specification for rigetti Quantum Cloud services";
    homepage = "https://github.com/rigetti/rpcq";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}