1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 cmake,
7 ninja,
8 scikit-build,
9 # Check Inputs
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "tweedledum";
15 version = "1.1.1";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "boschmitt";
20 repo = "tweedledum";
21 rev = "v${version}";
22 hash = "sha256-wgrY5ajaMYxznyNvlD0ul1PFr3W8oV9I/OVsStlZEBM=";
23 };
24
25 postPatch = ''
26 sed -i '/\[project\]/a version = "${version}"' pyproject.toml
27 sed -i '/\[project\]/a name = "tweedledum"' pyproject.toml
28 '';
29
30 nativeBuildInputs = [
31 cmake
32 ninja
33 scikit-build
34 ];
35 dontUseCmakeConfigure = true;
36
37 pythonImportsCheck = [ "tweedledum" ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40 pytestFlagsArray = [ "python/test" ];
41
42 meta = with lib; {
43 description = "A library for synthesizing and manipulating quantum circuits";
44 homepage = "https://github.com/boschmitt/tweedledum";
45 license = licenses.mit;
46 maintainers = with maintainers; [ drewrisinger ];
47 };
48}