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 pkg_resources deprecation warning #146

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

blag
Copy link
Contributor

@blag blag commented Aug 30, 2023

Running with Python 3.11 generates the following warning:

python3.11/site-packages/robots/__init__.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import get_distribution

This PR attempts to first import importlib.metadata.version before falling back to using pkg_resources.get_distribution.

@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Merging #146 (a0e653f) into master (7175419) will increase coverage by 6.63%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
+ Coverage   80.57%   87.21%   +6.63%     
==========================================
  Files           8       12       +4     
  Lines         139      305     +166     
  Branches       13       28      +15     
==========================================
+ Hits          112      266     +154     
- Misses         20       28       +8     
- Partials        7       11       +4     
Files Changed Coverage Δ
src/robots/__init__.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@Andrew-Chen-Wang Andrew-Chen-Wang left a comment

Choose a reason for hiding this comment

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

thx

Copy link
Member

@tony tony left a comment

Choose a reason for hiding this comment

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

LGTM

@tony tony merged commit ded08f1 into master Sep 7, 2023
tony added a commit that referenced this pull request Sep 7, 2023
@tony tony deleted the fix-pkg-resources-deprecation-warning branch September 7, 2023 12:16
@tony
Copy link
Member

tony commented Sep 7, 2023

@blag Live as of 6.1:

PyPI, releases, changelog

Does this do the trick?

@blag
Copy link
Contributor Author

blag commented Sep 19, 2023

@tony Yep, works perfectly. Thank you for the quick turnaround!

@tony
Copy link
Member

tony commented Sep 19, 2023

@blag Great!

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.

3 participants