From 65556eb53e184e78aaacce2a9e325ea4507bca2c Mon Sep 17 00:00:00 2001 From: Jen Herting Date: Wed, 5 Apr 2023 14:51:35 -0400 Subject: [PATCH] New package: py-qiskit-ibm-provider and more (#36661) * [py-singledispatchmethod] new package * [py-singledispatchmethod] added missing dependency * new package required for qiskit * [py-rustworkx] - removed redundant dependency on py-wheel - added dependency on py-numpy * [py-websocket-client] added version 1.5.1 * modified it is ahead of upstream * [py-qiskit-terra] - flake8 - removed duplicate dependencies - fixed acceptable range for py-symengine * [py-qiskit-terra] tweedledum no longer needed * [py-qiskit-terra] depends on py-singledispatchmethod * [py-qiskit-ibm-provider] new package --------- Co-authored-by: Sid Pendelberry --- .../py-qiskit-ibm-provider/package.py | 28 +++++++++++++++++++ .../packages/py-qiskit-terra/package.py | 15 +++++++++- .../builtin/packages/py-rustworkx/package.py | 26 +++++++++++++++++ .../py-singledispatchmethod/package.py | 18 ++++++++++++ .../packages/py-websocket-client/package.py | 1 + 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/py-qiskit-ibm-provider/package.py create mode 100644 var/spack/repos/builtin/packages/py-rustworkx/package.py create mode 100644 var/spack/repos/builtin/packages/py-singledispatchmethod/package.py diff --git a/var/spack/repos/builtin/packages/py-qiskit-ibm-provider/package.py b/var/spack/repos/builtin/packages/py-qiskit-ibm-provider/package.py new file mode 100644 index 0000000000..e095f7ae7f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-qiskit-ibm-provider/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyQiskitIbmProvider(PythonPackage): + """Qiskit IBM Quantum Provider for accessing the quantum devices and simulators + at IBM""" + + homepage = "https://github.com/Qiskit/qiskit-ibm-provider" + pypi = "qiskit-ibm-provider/qiskit-ibm-provider-0.5.1.tar.gz" + + version("0.5.1", sha256="0135d455d5fc4238efe1b852767c243fb995f003fbcac0bb836608426a0c0597") + + depends_on("python@3.7:", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-qiskit-terra@0.23.1:", type=("build", "run")) + depends_on("py-requests@2.19:", type=("build", "run")) + depends_on("py-requests-ntlm@1.1.0:", type=("build", "run")) + depends_on("py-numpy@1.13:", type=("build", "run")) + depends_on("py-urllib3@1.21.1:", type=("build", "run")) + depends_on("py-python-dateutil@2.8.0:", type=("build", "run")) + depends_on("py-websocket-client@1.5.1:", type=("build", "run")) + depends_on("py-websockets@10.0:", type=("build", "run")) + depends_on("py-typing-extensions@4.3:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-qiskit-terra/package.py b/var/spack/repos/builtin/packages/py-qiskit-terra/package.py index dbbed86947..d7d225f7cf 100644 --- a/var/spack/repos/builtin/packages/py-qiskit-terra/package.py +++ b/var/spack/repos/builtin/packages/py-qiskit-terra/package.py @@ -15,6 +15,7 @@ class PyQiskitTerra(PythonPackage): homepage = "https://github.com/Qiskit/qiskit-terra" pypi = "qiskit-terra/qiskit-terra-0.18.3.tar.gz" + version("0.23.3", sha256="8f2f61622c28ad38db95d9bbacb03b9743923581545df08eb5047fa86f4de198") version("0.22.2", sha256="efd212cd98479ebedc8cc1f93d4eb8039f21c07bd39a62065b584e02d72e632d") version("0.18.3", sha256="8737c8f1f4c6f29ec2fb02d73023f4854a396c33f78f4629a861a3e48fc789cc") @@ -24,7 +25,6 @@ class PyQiskitTerra(PythonPackage): depends_on("py-sympy@1.3:", type=("build", "run")) depends_on("py-dill@0.3:", type=("build", "run")) depends_on("py-python-dateutil@2.8.0:", type=("build", "run")) - depends_on("py-tweedledum@1.1:1", type=("build", "run"), when="^python@:3.11") depends_on("py-stevedore@3.0.0:", type=("build", "run")) depends_on("py-psutil@5:", type=("build", "run")) @@ -37,6 +37,7 @@ class PyQiskitTerra(PythonPackage): depends_on("py-fastjsonschema@2.10:", type=("build", "run")) depends_on("py-python-constraint@1.4:", type=("build", "run")) depends_on("py-symengine@0.7:", type=("build", "run")) + depends_on("py-tweedledum@1.1:1", type=("build", "run"), when="^python@:3.11") with when("@0.22.2"): depends_on("python@3.7:", type=("build", "run")) @@ -46,4 +47,16 @@ class PyQiskitTerra(PythonPackage): depends_on("py-symengine@0.9:", type=("build", "run")) depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) depends_on("py-shared-memory38", when="^python@:3.7", type=("build", "run")) + depends_on("py-tweedledum@1.1:1", type=("build", "run"), when="^python@:3.11") depends_on("py-importlib-metadata@:4", when="^python@:3.7", type=("build", "run")) + + with when("@0.23.3"): + depends_on("python@3.7:", type=("build", "run")) + depends_on("py-setuptools-rust", type="build") + depends_on("py-rustworkx@0.12.0:", type=("build", "run")) + depends_on("py-scipy@1.5:", type=("build", "run")) + depends_on("py-symengine@0.9:", type=("build", "run")) + depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) + depends_on("py-shared-memory38", when="^python@:3.7", type=("build", "run")) + depends_on("py-importlib-metadata@:4", when="^python@:3.7", type=("build", "run")) + depends_on("py-singledispatchmethod", when="^python@:3.7", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-rustworkx/package.py b/var/spack/repos/builtin/packages/py-rustworkx/package.py new file mode 100644 index 0000000000..2b22f70138 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-rustworkx/package.py @@ -0,0 +1,26 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyRustworkx(PythonPackage): + """Rustworkx was originally called retworkx and was was created initially to + be a replacement for qiskit's previous (and current) networkx usage (hence + the original name). The project was originally started to build a faster + directed graph to use as the underlying data structure for the DAG at the + center of qiskit-terra's transpiler. However, since it's initial + introduction the project has grown substantially and now covers all + applications that need to work with graphs which includes Qiskit.""" + + homepage = "https://github.com/Qiskit/rustworkx" + pypi = "rustworkx/rustworkx-0.12.1.tar.gz" + + version("0.12.1", sha256="13a19a2f64dff086b3bffffb294c4630100ecbc13634b4995d9d36a481ae130e") + + depends_on("python@3.7:", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-setuptools-rust", type="build") + depends_on("py-numpy@1.16:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-singledispatchmethod/package.py b/var/spack/repos/builtin/packages/py-singledispatchmethod/package.py new file mode 100644 index 0000000000..55313924e4 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-singledispatchmethod/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PySingledispatchmethod(PythonPackage): + """Backport of functools.singledispatchmethod to Python 2.7-3.7.""" + + homepage = "https://github.com/ikalnytskyi/singledispatchmethod" + pypi = "singledispatchmethod/singledispatchmethod-1.0.tar.gz" + + version("1.0", sha256="183a7fbeab53b9c9d182f8b8f9c2d7e109a7d40afaa30261d81dd8de68cd73bf") + + depends_on("py-setuptools", type="build") + depends_on("py-setuptools-scm", type="build") diff --git a/var/spack/repos/builtin/packages/py-websocket-client/package.py b/var/spack/repos/builtin/packages/py-websocket-client/package.py index 3d9ee07c10..295108f0e4 100644 --- a/var/spack/repos/builtin/packages/py-websocket-client/package.py +++ b/var/spack/repos/builtin/packages/py-websocket-client/package.py @@ -13,6 +13,7 @@ class PyWebsocketClient(PythonPackage): homepage = "https://github.com/websocket-client/websocket-client.git" pypi = "websocket-client/websocket-client-0.57.0.tar.gz" + version("1.5.1", sha256="3f09e6d8230892547132177f575a4e3e73cfdf06526e20cc02aa1c3b47184d40") version("1.4.1", sha256="f9611eb65c8241a67fb373bef040b3cf8ad377a9f6546a12b620b6511e8ea9ef") version("1.2.1", sha256="8dfb715d8a992f5712fff8c843adae94e22b22a99b2c5e6b0ec4a1a981cc4e0d") version(