python3Packages.pyquil: 4.6.1 -> 4.7.0

https://github.com/rigetti/pyquil/blob/v4.7.0/CHANGELOG.md
This commit is contained in:
Martin Weinelt
2024-03-12 18:24:45 +01:00
parent a59c687afb
commit d55c76bbc5
2 changed files with 2 additions and 35 deletions
@@ -15,7 +15,6 @@
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, pythonRelaxDepsHook
, qcs-sdk-python
@@ -31,7 +30,7 @@
buildPythonPackage rec {
pname = "pyquil";
version = "4.6.1";
version = "4.7.0";
pyproject = true;
disabled = pythonOlder "3.7";
@@ -40,13 +39,9 @@ buildPythonPackage rec {
owner = "rigetti";
repo = "pyquil";
rev = "refs/tags/v${version}";
hash = "sha256-93dHujgGEh9/r9epAiUcUCiFCG7SFTAFoQbjQwwKhN0=";
hash = "sha256-jzQv9XBJSxdpSWDEEPuHwYfIemelpmVKJUigpz6NWdo=";
};
patches = [
./pydantic.patch
];
pythonRelaxDeps = [
"lark"
"networkx"
@@ -1,28 +0,0 @@
diff --git a/pyproject.toml b/pyproject.toml
index 2677758..5bbe863 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,7 +30,7 @@ scipy = [
]
lark = "^0.11.1"
rpcq = "^3.10.0"
-pydantic = "^1.10.7"
+pydantic = ">=1.10.7"
networkx = ">=2.5"
importlib-metadata = { version = ">=3.7.3,<5", python = "<3.8" }
qcs-sdk-python = "0.14.3"
diff --git a/pyquil/external/rpcq.py b/pyquil/external/rpcq.py
index 719eca1..d814d7b 100644
--- a/pyquil/external/rpcq.py
+++ b/pyquil/external/rpcq.py
@@ -1,6 +1,9 @@
from typing import Dict, List, Union, Optional, Any
from typing_extensions import Literal
-from pydantic import BaseModel, Field
+try:
+ from pydantic.v1 import BaseModel, Field
+except ImportError:
+ from pydantic import BaseModel, Field
from rpcq.messages import TargetDevice as TargetQuantumProcessor