Skip to content

fix: Replace deprecated pkg_resources with importlib.metadata to clear DeprecationWarning#2392

Merged
Lulalaby merged 6 commits into
Pycord-Development:masterfrom
Revnoplex:master
Mar 17, 2024
Merged

fix: Replace deprecated pkg_resources with importlib.metadata to clear DeprecationWarning#2392
Lulalaby merged 6 commits into
Pycord-Development:masterfrom
Revnoplex:master

Conversation

@Revnoplex

@Revnoplex Revnoplex commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

Summary

Replaced pkg_resources with importlib.metadata as favoured here. Hence replacing get_distribution() with version().

This clears the following deprecation warning:

/home/username/pycord/venv/lib/python3.11/site-packages/discord/__main__.py:33: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Lulalaby
Lulalaby enabled auto-merge (squash) March 13, 2024 14:10
Lulalaby
Lulalaby previously approved these changes Mar 13, 2024
@Lulalaby
Lulalaby requested review from BobDotCom and removed request for plun1331 March 13, 2024 14:10
@plun1331

Copy link
Copy Markdown
Member

Should we have a changelog entry for this?

@JustaSqu1d

Copy link
Copy Markdown
Member

Should we have a changelog entry for this?

I don't think so because it doesn't affect the end-user?

@plun1331

Copy link
Copy Markdown
Member

Should we have a changelog entry for this?

I don't think so because it doesn't affect the end-user?

It removes a deprecation warning that appears in their terminal

@JustaSqu1d JustaSqu1d added the hold: changelog This pull request is missing a changelog entry label Mar 15, 2024

@JustaSqu1d JustaSqu1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a changelog entry

@Revnoplex

Copy link
Copy Markdown
Contributor Author

alr, I'll get onto it soon

auto-merge was automatically disabled March 15, 2024 07:43

Head branch was pushed to by a user without write access

@Revnoplex

Copy link
Copy Markdown
Contributor Author

Done

Comment thread CHANGELOG.md Outdated
Signed-off-by: Lala Sabathil <[email protected]>
plun1331
plun1331 previously approved these changes Mar 15, 2024
@plun1331 plun1331 removed the hold: changelog This pull request is missing a changelog entry label Mar 15, 2024
@plun1331
plun1331 enabled auto-merge (squash) March 15, 2024 14:52
Comment thread CHANGELOG.md Outdated
auto-merge was automatically disabled March 16, 2024 00:17

Head branch was pushed to by a user without write access

Co-authored-by: JustaSqu1d <[email protected]>
Signed-off-by: Revnoplex <[email protected]>
@plun1331
plun1331 enabled auto-merge (squash) March 16, 2024 03:45
@Lulalaby
Lulalaby disabled auto-merge March 17, 2024 01:55
@Lulalaby
Lulalaby merged commit 0c68e5f into Pycord-Development:master Mar 17, 2024
mykolasolodukha pushed a commit to mykolasolodukha/pycord that referenced this pull request Sep 17, 2024
…r DeprecationWarning (Pycord-Development#2392)

Signed-off-by: Lala Sabathil <[email protected]>
Signed-off-by: Revnoplex <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lala Sabathil <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]>

(cherry picked from commit 0c68e5f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: awaiting review Awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants