From 593677b0d52084f251af8afc4c740b7545687e82 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 23 Jul 2020 01:32:21 +0200 Subject: [PATCH] Change version stuff --- pyproject.toml | 2 +- royalpack/commands/royalpackversion.py | 10 +++++++--- royalpack/version.py | 3 --- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 royalpack/version.py diff --git a/pyproject.toml b/pyproject.toml index 27278001..9dbe6bf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.13.2" + version = "5.13.4" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/royalpackversion.py b/royalpack/commands/royalpackversion.py index bbd514ae..f2b17584 100644 --- a/royalpack/commands/royalpackversion.py +++ b/royalpack/commands/royalpackversion.py @@ -1,7 +1,7 @@ from typing import * -import royalnet.commands as rc -from ..version import semantic +import pkg_resources +import royalnet.commands as rc class RoyalpackCommand(rc.Command): @@ -11,11 +11,15 @@ class RoyalpackCommand(rc.Command): syntax: str = "" + @property + def royalpack_version(self): + return pkg_resources.get_distribution("royalpack").version + async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None: if __debug__: message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/]Unreleased[/url]\n" else: - message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{semantic}]{semantic}[/url]\n" + message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{self.royalpack_version}]{self.royalpack_version}[/url]\n" if "69" in semantic: message += "(Nice.)" await data.reply(message) diff --git a/royalpack/version.py b/royalpack/version.py deleted file mode 100644 index 4430300e..00000000 --- a/royalpack/version.py +++ /dev/null @@ -1,3 +0,0 @@ -import pkg_resources - -semantic = pkg_resources.get_distribution("royalpack").version