From 69626979493cf104ef3f33f48c60d644915b54aa Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Fri, 13 May 2022 10:33:43 -0400 Subject: [PATCH 1/2] python3Packages.cirq-core: 0.13.1 -> 0.14.1 --- .../python-modules/cirq-core/default.nix | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/cirq-core/default.nix b/pkgs/development/python-modules/cirq-core/default.nix index 92045eb3e3ef..74f8e488fd92 100644 --- a/pkgs/development/python-modules/cirq-core/default.nix +++ b/pkgs/development/python-modules/cirq-core/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { pname = "cirq-core"; - version = "0.13.1"; + version = "0.14.1"; disabled = pythonOlder "3.6"; @@ -38,32 +38,17 @@ buildPythonPackage rec { owner = "quantumlib"; repo = "cirq"; rev = "v${version}"; - sha256 = "sha256-MVfJ8iEeW8gFvCNTqrWfYpNNYuDAufHgcjd7Nh3qp8U="; + sha256 = "sha256-cIDwV3IBXrTJ4jC1/HYmduY3tLe/f6wj8CWZ4cnThG8="; }; sourceRoot = "source/${pname}"; - patches = [ - # present in upstream master - remove after 0.13.1 - (fetchpatch { - name = "fix-test-tolerances.part-1.patch"; - url = "https://github.com/quantumlib/Cirq/commit/eb1d9031e55d3c8801ea44abbb6a4132b2fc5126.patch"; - sha256 = "0ka24v6dfxnap9p07ni32z9zccbmw0lbrp5mcknmpsl12hza98xm"; - stripLen = 1; - }) - (fetchpatch { - name = "fix-test-tolerances.part-2.patch"; - url = "https://github.com/quantumlib/Cirq/commit/a28d601b2bcfc393336375c53e5915fd16455395.patch"; - sha256 = "0k2dqsm4ydn6556d40kc8j04jgjn59z4wqqg1jn1r916a7yxw493"; - stripLen = 1; - }) - ]; - postPatch = '' substituteInPlace requirements.txt \ --replace "matplotlib~=3.0" "matplotlib" \ --replace "networkx~=2.4" "networkx" \ - --replace "numpy~=1.16" "numpy" + --replace "numpy~=1.16" "numpy" \ + --replace "sympy<1.10" "sympy" ''; propagatedBuildInputs = [ @@ -93,9 +78,9 @@ buildPythonPackage rec { freezegun ]; - pytestFlagsArray = lib.optionals (!withContribRequires) [ + disabledTestPaths = lib.optionals (!withContribRequires) [ # requires external (unpackaged) libraries, so untested. - "--ignore=cirq/contrib/" + "cirq/contrib/" ]; disabledTests = [ "test_metadata_search_path" # tries to import flynt, which isn't in Nixpkgs From 9a8b76f789c541234bb88561af219190a49587f8 Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Fri, 13 May 2022 10:41:41 -0400 Subject: [PATCH 2/2] python3Packages.cirq: fix build Build was failing because it attempted to find top-level packages. See https://github.com/quantumlib/Cirq/issues/5291 --- pkgs/development/python-modules/cirq/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/cirq/default.nix b/pkgs/development/python-modules/cirq/default.nix index 6e428eeb4ef6..17623817e7b6 100644 --- a/pkgs/development/python-modules/cirq/default.nix +++ b/pkgs/development/python-modules/cirq/default.nix @@ -1,4 +1,5 @@ { buildPythonPackage +, fetchpatch , cirq-aqt , cirq-core , cirq-google @@ -14,6 +15,14 @@ buildPythonPackage rec { pname = "cirq"; inherit (cirq-core) version src meta; + patches = [ + (fetchpatch { + url = "https://github.com/quantumlib/Cirq/commit/b832db606e5f1850b1eda168a6d4a8e77d8ec711.patch"; + name = "pr-5330-prevent-implicit-packages.patch"; + sha256 = "sha256-HTEH3fFxPiBedaz5GxZjXayvoiazwHysKZIOzqwZmbg="; + }) + ]; + propagatedBuildInputs = [ cirq-aqt cirq-core