Unverified Commit a2ce3eeb authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

python312Packages.{cirq,cirq-core,cirq-google,cirq-rigetti,quil,pyquil}: cleanup & fix (#384232)

parents 163c1868 a49631e4
Loading
Loading
Loading
Loading
+24 −20
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  attrs,
  autoray ? null,
  buildPythonPackage,
  duet,
  fetchFromGitHub,
  freezegun,

  # build-system
  setuptools,

  # dependencies
  attrs,
  duet,
  matplotlib,
  networkx,
  numpy,
  opt-einsum,
  pandas,
  ply,
  pylatex ? null,
  pyquil ? null,
  pytest-asyncio,
  pytestCheckHook,
  pythonOlder,
  quimb ? null,
  requests,
  scipy,
  setuptools,
  sortedcontainers,
  sympy,
  tqdm,
  typing-extensions,
  autoray ? null,
  opt-einsum,
  ply,
  pylatex ? null,
  pyquil ? null,
  quimb ? null,

  # tests
  freezegun,
  pytest-asyncio,
  pytestCheckHook,

  withContribRequires ? false,
}:

@@ -34,8 +40,6 @@ buildPythonPackage rec {
  version = "1.4.1-unstable-2024-09-21";
  pyproject = true;

  disabled = pythonOlder "3.10";

  src = fetchFromGitHub {
    owner = "quantumlib";
    repo = "cirq";
@@ -77,9 +81,9 @@ buildPythonPackage rec {
    ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-asyncio
    freezegun
    pytest-asyncio
    pytestCheckHook
  ];

  disabledTestPaths = lib.optionals (!withContribRequires) [
@@ -99,12 +103,12 @@ buildPythonPackage rec {
      "test_prepare_two_qubit_state_using_sqrt_iswap"
    ];

  meta = with lib; {
  meta = {
    description = "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; [
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      drewrisinger
      fab
    ];
+2 −14
Original line number Diff line number Diff line
{
  buildPythonPackage,
  setuptools,
  cirq-core,
  freezegun,
  google-api-core,
  protobuf,
  freezegun,
  pytestCheckHook,
  setuptools,
  protobuf4,
  fetchpatch,
}:

buildPythonPackage rec {
@@ -19,16 +17,6 @@ buildPythonPackage rec {

  build-system = [ setuptools ];

  patches = [
    # https://github.com/quantumlib/Cirq/pull/6683 Support for protobuf5
    (fetchpatch {
      url = "https://github.com/quantumlib/Cirq/commit/bae02e4d83aafa29f50aa52073d86eb913ccb2d3.patch";
      hash = "sha256-MqHhKa38BTM6viQtWik0TQjN0OPdrwzCZkkqZsiyF5w=";
      includes = [ "cirq_google/serialization/arg_func_langs_test.py" ];
      stripLen = 1;
    })
  ];

  pythonRelaxDeps = [
    "protobuf"
  ];
+2 −17
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  cirq-core,
  fetchpatch2,
  setuptools,
  pyquil,
  pytestCheckHook,
  pythonOlder,
  qcs-sdk-python,
  setuptools,
  pytestCheckHook,
}:

buildPythonPackage rec {
@@ -15,18 +12,6 @@ buildPythonPackage rec {
  pyproject = true;
  inherit (cirq-core) version src;

  disabled = pythonOlder "3.10";

  patches = [
    # https://github.com/quantumlib/Cirq/pull/6734
    (fetchpatch2 {
      name = "fix-rigetti-check-for-aspen-family-device-kind.patch";
      url = "https://github.com/quantumlib/Cirq/commit/dd395fb71fb7f92cfd34f008bf2a98fc70b57fae.patch";
      stripLen = 1;
      hash = "sha256-EWB2CfMS2+M3zNFX5PwFNtEBdgJkNVUVNd+I/E6n9kI=";
    })
  ];

  sourceRoot = "${src.name}/${pname}";

  pythonRelaxDeps = [ "pyquil" ];
+10 −4
Original line number Diff line number Diff line
{
  buildPythonPackage,

  # build-system
  setuptools,

  # dependencies
  cirq-aqt,
  cirq-core,
  cirq-google,
@@ -7,11 +12,12 @@
  cirq-pasqal,
  cirq-rigetti,
  cirq-web,

  # tests
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
buildPythonPackage {
  pname = "cirq";
  pyproject = true;
  inherit (cirq-core) version src meta;
@@ -21,10 +27,10 @@ buildPythonPackage rec {
  dependencies = [
    cirq-aqt
    cirq-core
    cirq-ionq
    cirq-google
    cirq-rigetti
    cirq-ionq
    cirq-pasqal
    cirq-rigetti
    cirq-web
  ];

+8 −9
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  deprecated,
  fetchFromGitHub,

  deprecated,
  ipython,
  matplotlib-inline,
  nest-asyncio,
@@ -13,7 +14,6 @@
  pytest-asyncio,
  pytest-mock,
  pytestCheckHook,
  pythonOlder,
  qcs-sdk-python,
  respx,
  rpcq,
@@ -25,21 +25,20 @@

buildPythonPackage rec {
  pname = "pyquil";
  version = "4.15.0";
  version = "4.16.0";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "rigetti";
    repo = "pyquil";
    tag = "v${version}";
    hash = "sha256-zRXIMSgcFlTZQ5Y/1pSC30ZhvKj1Pn1+7SbTetEdzio=";
    hash = "sha256-6nJ0eozqbzHDF3e/Q/bVJnng1b+LUL2tsv4X7sWE9/0=";
  };

  pythonRelaxDeps = [
    "lark"
    "networkx"
    "numpy"
    "packaging"
    "qcs-sdk-python"
    "rpcq"
@@ -75,11 +74,11 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "pyquil" ];

  meta = with lib; {
  meta = {
    description = "Python library for creating Quantum Instruction Language (Quil) programs";
    homepage = "https://github.com/rigetti/pyquil";
    changelog = "https://github.com/rigetti/pyquil/blob/v${version}/CHANGELOG.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ fab ];
  };
}
Loading