2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
ninja,
|
|
|
|
scikit-build,
|
2021-12-06 16:07:01 +00:00
|
|
|
# Check Inputs
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
2021-04-13 19:44:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tweedledum";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.1.1";
|
2021-04-13 19:44:15 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-04-13 19:44:15 +00:00
|
|
|
owner = "boschmitt";
|
|
|
|
repo = "tweedledum";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-wgrY5ajaMYxznyNvlD0ul1PFr3W8oV9I/OVsStlZEBM=";
|
2021-04-13 19:44:15 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/\[project\]/a version = "${version}"' pyproject.toml
|
|
|
|
sed -i '/\[project\]/a name = "tweedledum"' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
scikit-build
|
|
|
|
];
|
2021-04-13 19:44:15 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "tweedledum" ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestFlagsArray = [ "python/test" ];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library for synthesizing and manipulating quantum circuits";
|
2021-04-13 19:44:15 +00:00
|
|
|
homepage = "https://github.com/boschmitt/tweedledum";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = licenses.mit;
|
2021-04-13 19:44:15 +00:00
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|