From 00040b39679cb1c1631934ff903e9d781438c486 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Fri, 16 May 2025 11:00:40 -0700 Subject: [PATCH] python3Packages.cirq-core: 1.4.1-unstable-2024-09-21 -> 1.5.0 Changelog: https://github.com/quantumlib/Cirq/releases/tag/v1.5.0 --- .../python-modules/cirq-core/default.nix | 10 ++- .../python-modules/typedunits/default.nix | 68 +++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/python-modules/typedunits/default.nix diff --git a/pkgs/development/python-modules/cirq-core/default.nix b/pkgs/development/python-modules/cirq-core/default.nix index 999954614b91..7dbf44955694 100644 --- a/pkgs/development/python-modules/cirq-core/default.nix +++ b/pkgs/development/python-modules/cirq-core/default.nix @@ -37,14 +37,14 @@ buildPythonPackage rec { pname = "cirq-core"; - version = "1.4.1-unstable-2024-09-21"; + version = "1.5.0"; pyproject = true; src = fetchFromGitHub { owner = "quantumlib"; repo = "cirq"; - rev = "3fefe2984a1203c0bf647c1ea84f4882b05f8477"; - hash = "sha256-/WDKVxNJ8pewTLAFTyAZ/nnYcJSLubEJcn7qoJslZ3U="; + tag = "v${version}"; + hash = "sha256-4FgXX4ox7BkjmLecxsvg0/JpcrHPn6hlFw5rk4bn9Cc="; }; sourceRoot = "${src.name}/${pname}"; @@ -98,6 +98,10 @@ buildPythonPackage rec { ++ lib.optionals stdenv.hostPlatform.isAarch64 [ # https://github.com/quantumlib/Cirq/issues/5924 "test_prepare_two_qubit_state_using_sqrt_iswap" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # test_scalar_division[scalar9-terms9-terms_expected9] result differs in the final digit + "test_scalar_division" ]; meta = { diff --git a/pkgs/development/python-modules/typedunits/default.nix b/pkgs/development/python-modules/typedunits/default.nix new file mode 100644 index 000000000000..c8ba6af13087 --- /dev/null +++ b/pkgs/development/python-modules/typedunits/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + stdenv, + cython, + setuptools, + attrs, + numpy, + protobuf, + pyparsing, + pytestCheckHook, +}: + +buildPythonPackage { + pname = "typedunits"; + version = "0.0.1.dev20250509200845"; + pyproject = true; + + src = fetchFromGitHub { + owner = "quantumlib"; + repo = "TypedUnits"; + # PyPi ships platform- and python- specific wheels, so pin the matching source + rev = "95e698b10454dc8dffdb708d56199a748e6dab75"; + hash = "sha256-mNo2s1sIMOa7zYfp6XyF8CBQ840+XvN0Ek59W6bRqeM="; + }; + + build-system = [ + cython + setuptools + ]; + + dependencies = [ + attrs + cython + numpy + protobuf + pyparsing + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # Rounding differences + "test_float_to_twelths_frac" + ]; + + disabledTestPaths = [ + # Flaky due to host timing differences under load + "test_perf/test_array_with_dimension_performance.py" + "test_perf/test_value__array_performance.py" + "test_perf/test_value_performance.py" + "test_perf/test_value_with_dimension_performance.py" + ]; + + pythonImportsCheck = [ + "tunits" + ]; + + meta = { + description = "Units and dimensions library with support for static dimensionality checking and protobuffer serialization"; + homepage = "https://github.com/quantumlib/TypedUnits"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.sarahec ]; + }; +}