From 595ddd2270d85008672dc47996deaff19735865b Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 26 Jul 2022 14:22:34 +0200 Subject: [PATCH 1/4] Version number is now fed into setup.py. --- _version.py | 1 + setup.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 _version.py diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..ca70210 --- /dev/null +++ b/_version.py @@ -0,0 +1 @@ +__version__ = "latest" diff --git a/setup.py b/setup.py index 973a611..8aa9599 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,13 @@ from setuptools import setup, find_packages +from _version import __version__ -with open('requirements.txt', encoding="utf-16") as f: + +with open("requirements.txt", encoding="utf-16") as f: required = f.read().splitlines() setup( - version="0.1.0", + version=__version__, name="query_performance_gauge", packages=find_packages(), description="Measure how long queries take.", From 02af779f69c071e71e40921af963b21e4d1f78c1 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 26 Jul 2022 14:22:48 +0200 Subject: [PATCH 2/4] Version number is now printed at the start of each session. --- query_performance_gauge.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/query_performance_gauge.py b/query_performance_gauge.py index 702e8d0..a93b6a0 100644 --- a/query_performance_gauge.py +++ b/query_performance_gauge.py @@ -6,6 +6,7 @@ import mysql.connector.connection import trino.dbapi from connections import get_connection, clean_up_connection +from _version import __version__ def run_measuring_session(config: dict) -> None: @@ -15,6 +16,7 @@ def run_measuring_session(config: dict) -> None: :param config: the full config for the measuring session. :return: None """ + print(f"Query Performance Gauge - Version: {__version__}") print("Starting the measuring session.") connection = get_connection(config["connection_details"]) From 4c65bf7297e0fafc95bdee088c12b2b5f422d568 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 26 Jul 2022 14:30:59 +0200 Subject: [PATCH 3/4] Updated version. --- _version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_version.py b/_version.py index ca70210..d3ec452 100644 --- a/_version.py +++ b/_version.py @@ -1 +1 @@ -__version__ = "latest" +__version__ = "0.2.0" From b1a9657d8edb0456a7eb1ff455aef8f2e577491d Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 26 Jul 2022 14:31:20 +0200 Subject: [PATCH 4/4] Updated changelog. --- CHANGELOG.MD | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index e834bff..6c74205 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,8 +1,8 @@ -# Changelog +# Changelog -## Unreleased - -### Added - -- Successful print message for each query will now also show the number of rows returned by the query. +## [0.2.0] - 2022-07-26 +### Added +- Sessions will now print the number of rows obtained from each successfully executed query. +- The tool version is now printed at the beginning of each session to leave a proper trace of what was the running + version for a results file. \ No newline at end of file