From 3341d794124a7f8c4cefe3435fce854c6cc73e11 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Tue, 30 May 2023 10:52:24 -0700 Subject: [PATCH] fix: The default QCSClient will now load without having QCS credentials (#1582) --- poetry.lock | 32 ++++++++++++++++---------------- pyproject.toml | 2 +- pyquil/api/_quantum_computer.py | 10 +--------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2a40555d7..c5e118f07 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry and should not be changed by hand. [[package]] name = "alabaster" @@ -1943,24 +1943,24 @@ py = {version = "*", markers = "implementation_name == \"pypy\""} [[package]] name = "qcs-sdk-python" -version = "0.6.0rc2" +version = "0.7.0" description = "Python interface for the QCS Rust SDK" category = "main" optional = false python-versions = "*" files = [ - {file = "qcs_sdk_python-0.6.0rc2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:8194656123f8d3a4b8f9b67d5bae5db6d9659dd99ea078e1c5839c092631f366"}, - {file = "qcs_sdk_python-0.6.0rc2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b6a4e48f75115456bc71f367be5b422662642c2092e949d1e0dd66394278728"}, - {file = "qcs_sdk_python-0.6.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1dd7072afd4304b2bbcacebcd4467b490518d61488a32c794c08e12a13984492"}, - {file = "qcs_sdk_python-0.6.0rc2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:d9a90f96d1a00bbfbbbd4cb52f083ce38c26a476b6038a83cb8990a48f22ca55"}, - {file = "qcs_sdk_python-0.6.0rc2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:957cec626a5e429ff7c7f1779ae4121d564bfad92b03f83f7dba2636be865eae"}, - {file = "qcs_sdk_python-0.6.0rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ffc6c8c7c99d570ccd879aa91c5aba31688c1675f1edc3725bc1a8060d2b0e7"}, - {file = "qcs_sdk_python-0.6.0rc2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:a4460b43dc04c0cf5f08c3c816f7d7fa3b72d4e12956996806a2f04f78c0d19e"}, - {file = "qcs_sdk_python-0.6.0rc2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:629a84d0f990a51749acfb2018bf076cd2f685198443bb38fa1dd8502901540e"}, - {file = "qcs_sdk_python-0.6.0rc2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128276c4043a392d02099fd1dee03a2c847f75ef8b68857fd066da1834453d5f"}, - {file = "qcs_sdk_python-0.6.0rc2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:4bc50f793cb02edcb5cc471726fb7b487ae45e93a433df38ab4a1b1d64a1105d"}, - {file = "qcs_sdk_python-0.6.0rc2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4185e3508460ee94f11100c76b7f08dda1754c64b4d993a5f17f01bd80675ec5"}, - {file = "qcs_sdk_python-0.6.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcc748934f4db87807d2483f995f88939b053fa2cbac36b7949082a392afca3d"}, + {file = "qcs_sdk_python-0.7.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:940ef8caca46a80b85b755d50afc339af5de7e620b8bd3f87cac5fed0659a142"}, + {file = "qcs_sdk_python-0.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4637a087272ded2c884f497b93795ecceb85f508af81b8d5b8403ea92aee85cb"}, + {file = "qcs_sdk_python-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:921e5b3bbf700f1e423db069e1318dae0448dd53777f1e03dd8d48acda885c14"}, + {file = "qcs_sdk_python-0.7.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:8b056988d2e4720ab8c6ac3c5cc03e4150552b1ecf20dfa567be78e8f00b2dd9"}, + {file = "qcs_sdk_python-0.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6db45852f3cfe463058d0c3d2efde720031b78036cb7a68770133520f9bb74c5"}, + {file = "qcs_sdk_python-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ba6d1b608f7b410097da45a930a912696c751a131d4e4d08f288bfff5bcb6ca"}, + {file = "qcs_sdk_python-0.7.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:a131d98b57f3448ac3539908069d7e609fc5d7f15508a81d94cc1903c5f32a86"}, + {file = "qcs_sdk_python-0.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39390760fcbbfb328297eb4007ec22d6f03c65b8776d64b4ca31afb617793edf"}, + {file = "qcs_sdk_python-0.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c106aa58034daa3a9c33529a1ea07dd8412284a4822af1feac5ef33e940fd4a"}, + {file = "qcs_sdk_python-0.7.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:b83e3311a0eb969c65450a4ad4e295a72ae0fade14bbe3a485ca8d5edb80874d"}, + {file = "qcs_sdk_python-0.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:197005a78bb389a848a9dbe9cad1f9fc335d9f659a454c528bd4a652b2541e5f"}, + {file = "qcs_sdk_python-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac781fa151e9266f193fca8ef8b637e4053c739f2b062fba81afc28cd57c19c6"}, ] [[package]] @@ -2553,10 +2553,10 @@ docs = ["jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9) testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [extras] -docs = ["Sphinx", "nbsphinx", "pandoc", "recommonmark", "sphinx-rtd-theme"] +docs = ["Sphinx", "sphinx-rtd-theme", "nbsphinx", "recommonmark", "pandoc"] latex = ["ipython"] [metadata] lock-version = "2.0" python-versions = "^3.8,<3.12" -content-hash = "482aa6cef6e29c9ec1bebdfc5ad995f504db365fe43fbf0343d5177329edb1a1" +content-hash = "d998e63bde8599b2a6307ede5a6ffb139c30d67ae29d84cd0f1184230f158234" diff --git a/pyproject.toml b/pyproject.toml index a826520e5..ba8f65c4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ rpcq = "^3.10.0" pydantic = "^1.10.7" networkx = "^2.5" importlib-metadata = { version = ">=3.7.3,<5", python = "<3.8" } -qcs-sdk-python = "0.6.0rc.2" +qcs-sdk-python = "0.7.0" retry = "^0.9.2" types-python-dateutil = "^2.8.19" types-retry = "^0.9.9" diff --git a/pyquil/api/_quantum_computer.py b/pyquil/api/_quantum_computer.py index 7f6650897..d054cf724 100644 --- a/pyquil/api/_quantum_computer.py +++ b/pyquil/api/_quantum_computer.py @@ -14,7 +14,6 @@ # limitations under the License. ############################################################################## import itertools -import logging import re import socket import subprocess @@ -40,7 +39,6 @@ from qcs_sdk import QCSClient from qcs_sdk.qpu import list_quantum_processors -from qcs_sdk.qpu.client import LoadClientError from pyquil.api._abstract_compiler import AbstractCompiler, QuantumExecutable from pyquil.api._compiler import QPUCompiler, QVMCompiler @@ -797,13 +795,7 @@ def get_qc( .. _QCS API Docs: https://docs.api.qcs.rigetti.com/#tag/endpoints """ - - if client_configuration is None: - try: - client_configuration = QCSClient.load() - except LoadClientError: - logging.getLogger().info("No QCS client configuration found, only generic QVMs will be accessible.") - client_configuration = QCSClient() + client_configuration = QCSClient.load() # 1. Parse name, check for redundant options, canonicalize names. prefix, qvm_type, noisy = _parse_name(name, as_qvm, noisy)