From ef5e1d99353331c92888a59d04bdf8ea7ae64a38 Mon Sep 17 00:00:00 2001 From: NiumXp Date: Thu, 1 Feb 2024 10:34:22 -0300 Subject: [PATCH] add more information in 'norminette --version' command (#483) * fix norminette version acording to pyptoject.toml * add to 'norminette version' shows information about Python and OS version * add a comment to ISSUE_TEMPLATE alerting user to paste the norminette version --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +--- norminette/__init__.py | 2 +- norminette/__main__.py | 7 ++++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d1a662c3..4b8864d5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,9 +15,7 @@ Please use markdown to send the code here. **Additional infos** - - OS: - - python3 --version: - - norminette -v: +Copy and paste the output of `norminette --version` command here. **Additional context** Add any other context about the problem here. diff --git a/norminette/__init__.py b/norminette/__init__.py index 24965a25..5251e95f 100644 --- a/norminette/__init__.py +++ b/norminette/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.3.54" +__version__ = "3.3.55" __name__ = "norminette" __author__ = "42" __author__email__ = "pedago@42.fr" diff --git a/norminette/__main__.py b/norminette/__main__.py index 632025d2..2b6509e4 100644 --- a/norminette/__main__.py +++ b/norminette/__main__.py @@ -1,6 +1,7 @@ import glob import sys import pathlib +import platform from importlib.metadata import version import argparse @@ -14,6 +15,10 @@ import subprocess +version_text = "norminette" + version("norminette") +version_text += f", Python {platform.python_version()}" +version_text += f", {platform.platform()}" + def main(): parser = argparse.ArgumentParser() @@ -40,7 +45,7 @@ def main(): "-v", "--version", action="version", - version="norminette " + version("norminette"), + version=version_text, ) parser.add_argument( "--cfile",