Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace pkg_resources with importlib.metadata #935

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

tachikoma-li
Copy link
Contributor

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

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

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

@tachikoma-li tachikoma-li marked this pull request as ready for review April 3, 2024 05:49
@tachikoma-li tachikoma-li requested a review from a team as a code owner April 3, 2024 05:49
@AbeCoull AbeCoull self-requested a review April 3, 2024 17:32
@@ -39,9 +38,7 @@
from braket.tasks.local_quantum_task import LocalQuantumTask
from braket.tasks.local_quantum_task_batch import LocalQuantumTaskBatch

_simulator_devices = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the contribution!

Seems that Python 3.9 has a different behavior for using entry_points

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@math411 thanks for pointing this out. Updated to use a backport for Python 3.9 as recommend by the offical doc (see the "Compatibility Note" part).

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tachikoma-li
Copy link
Contributor Author

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

@AbeCoull AbeCoull merged commit 64a2536 into amazon-braket:main Apr 9, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants