From ab525faf054d42eb18b7c7f899e8df057b6b63ce Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Mon, 31 Aug 2020 21:56:40 -0400 Subject: [PATCH] python3Packages.cirq: unbreak Remove unneeded test disables. Add changelog. Unpin most python dependencies. --- .../python-modules/cirq/default.nix | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/cirq/default.nix b/pkgs/development/python-modules/cirq/default.nix index 83fc0d371c1d..21f9c5446c39 100644 --- a/pkgs/development/python-modules/cirq/default.nix +++ b/pkgs/development/python-modules/cirq/default.nix @@ -48,6 +48,15 @@ buildPythonPackage rec { }) ]; + postPatch = '' + substituteInPlace requirements.txt \ + --replace "freezegun~=0.3.15" "freezegun" \ + --replace "matplotlib~=3.0" "matplotlib" \ + --replace "networkx~=2.4" "networkx" \ + --replace "numpy~=1.16, < 1.19" "numpy" \ + --replace "protobuf~=3.12.0" "protobuf" + ''; + propagatedBuildInputs = [ freezegun google_api_core @@ -64,7 +73,7 @@ buildPythonPackage rec { ]; doCheck = true; - # pythonImportsCheck = [ "cirq" "cirq.Ciruit" ]; # cirq's importlib hook doesn't work here + # pythonImportsCheck = [ "cirq" "cirq.Circuit" ]; # cirq's importlib hook doesn't work here dontUseSetuptoolsCheck = true; checkInputs = [ pytestCheckHook @@ -78,16 +87,10 @@ buildPythonPackage rec { pytestFlagsArray = [ "--ignore=dev_tools" # Only needed when developing new code, which is out-of-scope + "--benchmark-disable" # Don't need to run benchmarks when packaging. ]; disabledTests = [ - "test_serialize_sympy_constants" # fails due to small error in pi (~10e-7) - "test_convert_to_ion_gates" # fails due to rounding error, 0.75 != 0.750...2 - - # Newly disabled tests on cirq 0.8 - # TODO: test & figure out why failing - "engine_job_test" - "test_health" - "test_run_delegation" + "test_convert_to_ion_gates" # fails on some systems due to rounding error, 0.75 != 0.750...2 ] ++ lib.optionals stdenv.isAarch64 [ # Seem to fail due to math issues on aarch64? "expectation_from_wavefunction" @@ -97,6 +100,7 @@ buildPythonPackage rec { meta = with lib; { description = "A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits."; homepage = "https://github.com/quantumlib/cirq"; + changelog = "https://github.com/quantumlib/Cirq/releases/tag/v${version}"; license = licenses.asl20; maintainers = with maintainers; [ drewrisinger ]; };