amazon-braket / amazon-braket-sdk-python

A Python SDK for interacting with quantum devices on Amazon Braket
https://aws.amazon.com/braket/
Apache License 2.0
294 stars 118 forks source link

fix: Replace pkg_resources with importlib.metadata #935

Closed tachikoma-li closed 3 months ago

tachikoma-li commented 3 months ago

Description of changes:

pkg_resources is deprecated since setuptools > 67.5. Import in src/braket/devices/local_simulator.py would cause the following warning

DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

It might be good to replace pkg_resources with other Python built-in modules, like importlib.metadata.

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (5b21c12) to head (cb4b0e4).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #935 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 133 133 Lines 8906 8909 +3 Branches 2007 2008 +1 ========================================= + Hits 8906 8909 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tachikoma-li commented 3 months ago

Hi @math411, thanks for the review! I don't have the write permission to the repo. Feel free to merge when you see fit.