Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR Qiskit#1347 added `setuptools` to `requirements-dev.txt` in an effort to make `qiskit-ibm-runtime` work with Python 3.12. However, `qiskit_ibm_runtime/api/session.py` actually imports `pkg_resources`, which is provided by setuptools, so really setuptools should have been added to [`REQUIREMENTS`](https://github.com/Qiskit/qiskit-ibm-runtime/blob/e152d122782959a04ebf2330f776d4c4e309ad14/setup.py#L21) in `setup.py` so that it is installed automatically for any downstream users of Qiskit Runtime, too. Better yet, however, is to drop this explicit dependency on setuptools, since [`pkg_resources` is deprecated](https://setuptools.pypa.io/en/latest/pkg_resources.html) in favor of `importlib`. Hence, this PR migrates from `pkg_resources` to `importlib.metadata` (there are a few more words about this [here](googleapis/python-api-core#27 (comment))). My investigation into this was prompted by us trying to add Python 3.12 support to the circuit-knitting-toolbox (Qiskit/qiskit-addon-cutting#429), and seeing CI errors prompted by `qiskit-ibm-runtime`'s importing of `pkg_resources`. Co-authored-by: Kevin Tian <[email protected]>
- Loading branch information