summary refs log tree commit diff
path: root/pkgs/development/python-modules/qasm2image/default.nix
blob: 9748e3e4348388fb4ef18879c83738a39d15ce20 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, cairocffi
, cairosvg
, cffi
, qiskit
, svgwrite
, colorama
, python
, pythonOlder
}:

buildPythonPackage {
  pname = "qasm2image";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "nelimee";
    repo = "qasm2image";
    rev = "2c01756946ba9782973359dbd7bbf6651af6bee5";
    sha256 = "1bnkzv7wrdvrq71dmsqanb3v2hcsxh5zaglfcxm2d9zzpmvb4a2n";
  };

  disabled = pythonOlder "3.5";

  propagatedBuildInputs = [
    cairocffi
    cairosvg
    cffi
    qiskit
    svgwrite
  ];

  checkInputs = [
    colorama
  ];
  checkPhase = ''
    ${python.interpreter} tests/launch_tests.py
  '';

  LC_ALL="en_US.UTF-8";

  meta = {
    description = "A Python module to visualise quantum circuit";
    homepage    = "https://github.com/nelimeee/qasm2image";
    license     = lib.licenses.cecill-b;
    maintainers = with lib.maintainers; [
      pandaman
    ];
  };
}