From 7aeb024791da69934b336b716ea18ce4c26d8b53 Mon Sep 17 00:00:00 2001 From: shiftinv Date: Fri, 20 Oct 2023 16:14:33 +0200 Subject: [PATCH] chore: resolve lint issue --- scripts/ci/versiontool.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ci/versiontool.py b/scripts/ci/versiontool.py index a414f28307..cec50cff3d 100644 --- a/scripts/ci/versiontool.py +++ b/scripts/ci/versiontool.py @@ -10,7 +10,7 @@ from typing import NamedTuple, NoReturn TARGET_FILE = Path("disnake/__init__.py") -INIT = TARGET_FILE.read_text("utf-8") +ORIG_INIT_CONTENTS = TARGET_FILE.read_text("utf-8") version_re = re.compile(r"(\d+)\.(\d+)\.(\d+)(?:(a|b|rc)(\d+)?)?") @@ -60,7 +60,7 @@ def to_versioninfo(self) -> str: def get_current_version() -> VersionInfo: - match = re.search(r"^__version__\b.*\"(.+?)\"$", INIT, re.MULTILINE) + match = re.search(r"^__version__\b.*\"(.+?)\"$", ORIG_INIT_CONTENTS, re.MULTILINE) assert match, "could not find current version in __init__.py" return VersionInfo.from_str(match[1]) @@ -113,13 +113,13 @@ def main() -> None: else: new_version = VersionInfo.from_str(new_version_str) - text = INIT - text = replace_line(text, r"^__version__\b", f'__version__ = "{str(new_version)}"') + text = ORIG_INIT_CONTENTS + text = replace_line(text, r"^__version__\b", f'__version__ = "{new_version!s}"') text = replace_line( text, r"^version_info\b", f"version_info: VersionInfo = {new_version.to_versioninfo()}" ) - if text != INIT: + if text != ORIG_INIT_CONTENTS: TARGET_FILE.write_text(text, "utf-8") print(str(new_version))