diff --git a/doc/conf.py b/doc/conf.py index 2a8193e55..a2548fc65 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,12 +1,11 @@ """Sphinx configuration.""" import datetime - -import pkg_resources +from importlib.metadata import version # Sphinx configuration below. project = "amazon-braket-sdk" -version = pkg_resources.require(project)[0].version +version = version(project) release = version copyright = "{}, Amazon.com".format(datetime.datetime.now().year) diff --git a/setup.py b/setup.py index 6c0a9e984..34d220161 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ "amazon-braket-schemas>=1.21.0", "amazon-braket-default-simulator>=1.21.2", "oqpy~=0.3.5", - "setuptools", "backoff", "boltons", "boto3>=1.28.53", @@ -41,6 +40,7 @@ "openpulse", "openqasm3", "sympy", + "backports.entry-points-selectable", ], extras_require={ "test": [ diff --git a/src/braket/devices/local_simulator.py b/src/braket/devices/local_simulator.py index faee13fdf..69fcfdaff 100644 --- a/src/braket/devices/local_simulator.py +++ b/src/braket/devices/local_simulator.py @@ -13,14 +13,13 @@ from __future__ import annotations +import sys from functools import singledispatchmethod from itertools import repeat from multiprocessing import Pool from os import cpu_count from typing import Any, Optional, Union -import pkg_resources - from braket.ahs.analog_hamiltonian_simulation import AnalogHamiltonianSimulation from braket.annealing.problem import Problem from braket.circuits import Circuit @@ -39,9 +38,12 @@ from braket.tasks.local_quantum_task import LocalQuantumTask from braket.tasks.local_quantum_task_batch import LocalQuantumTaskBatch -_simulator_devices = { - entry.name: entry for entry in pkg_resources.iter_entry_points("braket.simulators") -} +if sys.version_info.minor == 9: + from backports.entry_points_selectable import entry_points +else: + from importlib.metadata import entry_points + +_simulator_devices = {entry.name: entry for entry in entry_points(group="braket.simulators")} class LocalSimulator(Device):