From a8cd5d84c35e3ebdb39c9dcb628f3ee6fe3cef6c Mon Sep 17 00:00:00 2001 From: Revnoplex <62947003+Revnoplex@users.noreply.github.com> Date: Thu, 14 Mar 2024 00:34:32 +1100 Subject: [PATCH 1/6] Replace deprecated pkg_resources to clear DeprecationWarning --- discord/__main__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/__main__.py b/discord/__main__.py index 12b5b5a1c3..2e4049d11a 100644 --- a/discord/__main__.py +++ b/discord/__main__.py @@ -30,7 +30,7 @@ from typing import Tuple import aiohttp -import pkg_resources +import importlib.metadata import discord @@ -47,9 +47,9 @@ def show_version() -> None: "- py-cord v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(version_info) ) if version_info.releaselevel != "final": - pkg = pkg_resources.get_distribution("py-cord") - if pkg: - entries.append(f" - py-cord pkg_resources: v{pkg.version}") + version = importlib.metadata.version("py-cord") + if version: + entries.append(f" - py-cord importlib.metadata: v{version}") entries.append(f"- aiohttp v{aiohttp.__version__}") uname = platform.uname() From 3363d79363587d14472327c09836f40166fc0bd7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:54:14 +0000 Subject: [PATCH 2/6] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/__main__.py b/discord/__main__.py index 2e4049d11a..ed34bdf42a 100644 --- a/discord/__main__.py +++ b/discord/__main__.py @@ -24,13 +24,13 @@ """ import argparse +import importlib.metadata import platform import sys from pathlib import Path from typing import Tuple import aiohttp -import importlib.metadata import discord From b5254e819bd24769a18b553e42dc87daaf59ed43 Mon Sep 17 00:00:00 2001 From: Revnoplex <62947003+Revnoplex@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:43:42 +1100 Subject: [PATCH 3/6] Add changelog entry for this pr --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b74b924c..4b35a802db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) +- Fixed a `DeprecationWarning` from being displayed when running `python -m discord -v` by replacing the depricated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) ### Changed From 4c94904bc31a3642117fb66209110606ac3e801a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:44:13 +0000 Subject: [PATCH 4/6] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b35a802db..8638bbfd07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,9 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) -- Fixed a `DeprecationWarning` from being displayed when running `python -m discord -v` by replacing the depricated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) +- Fixed a `DeprecationWarning` from being displayed when running `python -m discord -v` + by replacing the depricated module. + ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) ### Changed From b3050f0791ef761b3f9e61c371e311b861213cb8 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Fri, 15 Mar 2024 08:46:48 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md Signed-off-by: Lala Sabathil --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8638bbfd07..b3025ae707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) - Fixed a `DeprecationWarning` from being displayed when running `python -m discord -v` - by replacing the depricated module. + by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392)) ### Changed From 890646557ae00fd1e96770a68ec015a18583a6be Mon Sep 17 00:00:00 2001 From: Revnoplex <62947003+Revnoplex@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:17:54 +1100 Subject: [PATCH 6/6] Update CHANGELOG.md Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Revnoplex <62947003+Revnoplex@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3025ae707..ac49862f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `Member.move_to` and `Member.edit` to reflect actual behavior. ([#2386](https://github.com/Pycord-Development/pycord/pull/2386)) -- Fixed a `DeprecationWarning` from being displayed when running `python -m discord -v` +- Fixed a deprecation warning from being displayed when running `python -m discord -v` by replacing the deprecated module. ([#2392](https://github.com/Pycord-Development/pycord/pull/2392))