From 5ac9f0e0f062aa8b6232e2094daf0a6285a8ad44 Mon Sep 17 00:00:00 2001 From: Daniel Diblik Date: Mon, 18 Mar 2024 14:44:34 +0100 Subject: [PATCH] Refactor dir hierarchy Signed-off-by: Daniel Diblik --- .packit.yaml | 1 + src/tesar/__init__.py | 6 +++--- src/{ => tesar}/dispatch/__init__.py | 8 +++++--- src/{ => tesar}/dispatch/__main__.py | 6 +++--- src/{ => tesar}/dispatch/brew_api.py | 2 +- src/{ => tesar}/dispatch/copr_api.py | 4 ++-- src/{ => tesar}/dispatch/dispatch_globals.py | 0 src/{ => tesar}/dispatch/tf_send_request.py | 4 ++-- src/{ => tesar}/report/__init__.py | 0 src/{ => tesar}/report/__main__.py | 4 ++-- tests/test_args.py | 2 +- 11 files changed, 20 insertions(+), 17 deletions(-) rename src/{ => tesar}/dispatch/__init__.py (99%) rename src/{ => tesar}/dispatch/__main__.py (96%) rename src/{ => tesar}/dispatch/brew_api.py (98%) rename src/{ => tesar}/dispatch/copr_api.py (97%) rename src/{ => tesar}/dispatch/dispatch_globals.py (100%) rename src/{ => tesar}/dispatch/tf_send_request.py (98%) rename src/{ => tesar}/report/__init__.py (100%) rename src/{ => tesar}/report/__main__.py (99%) diff --git a/.packit.yaml b/.packit.yaml index 31f3ec1..a90f87c 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -18,5 +18,6 @@ jobs: owner: danmyway project: tesar trigger: pull_request + update_release: false targets: - fedora-stable diff --git a/src/tesar/__init__.py b/src/tesar/__init__.py index 4b1dfb4..fb4fc52 100644 --- a/src/tesar/__init__.py +++ b/src/tesar/__init__.py @@ -1,14 +1,14 @@ import contextlib import sys -from dispatch import get_arguments, get_datetime +from tesar.dispatch import get_arguments, get_datetime ARGS = get_arguments() def main(): if ARGS.action == "test": - from dispatch.__main__ import main as dispatch + from tesar.dispatch.__main__ import main as dispatch if ARGS.log: datetime_str = get_datetime() @@ -18,6 +18,6 @@ def main(): else: sys.exit(dispatch()) elif ARGS.action == "report": - from report.__main__ import main as report + from tesar.report.__main__ import main as report sys.exit(report()) diff --git a/src/dispatch/__init__.py b/src/tesar/dispatch/__init__.py similarity index 99% rename from src/dispatch/__init__.py rename to src/tesar/dispatch/__init__.py index 200c4ec..66a99f6 100644 --- a/src/dispatch/__init__.py +++ b/src/tesar/dispatch/__init__.py @@ -291,19 +291,21 @@ def get_arguments(args=None): help="""Download logs for requested run(s).""", ) report.add_argument( - '--skip-pass', + "--skip-pass", action="store_true", help="Skip PASSED results while showing table and while downloading logs.", ) report.add_argument( "--compare", action="store_true", - help="""Build a comparison table for several runs results""") + help="""Build a comparison table for several runs results""", + ) report.add_argument( "-u", "--unify-results", action="append", - help="""Plans name to be treated as one in plan1=plan2 format, useful for runs comparison in case of renaming.""") + help="""Plans name to be treated as one in plan1=plan2 format, useful for runs comparison in case of renaming.""", + ) tasks_source = report.add_mutually_exclusive_group() tasks_source.add_argument( "-lt", diff --git a/src/dispatch/__main__.py b/src/tesar/dispatch/__main__.py similarity index 96% rename from src/dispatch/__main__.py rename to src/tesar/dispatch/__main__.py index 8cfe381..497ed9e 100644 --- a/src/dispatch/__main__.py +++ b/src/tesar/dispatch/__main__.py @@ -5,13 +5,13 @@ import requests -from dispatch import ( +from tesar.dispatch import ( get_arguments, get_compose_mapping, get_logging, ) -from dispatch.dispatch_globals import ARTIFACT_MAPPING, PACKAGE_MAPPING -from dispatch.tf_send_request import submit_test +from tesar.dispatch.dispatch_globals import ARTIFACT_MAPPING, PACKAGE_MAPPING +from tesar.dispatch.tf_send_request import submit_test LOGGER = get_logging() ARGS = get_arguments() diff --git a/src/dispatch/brew_api.py b/src/tesar/dispatch/brew_api.py similarity index 98% rename from src/dispatch/brew_api.py rename to src/tesar/dispatch/brew_api.py index 13ce780..adc0904 100644 --- a/src/dispatch/brew_api.py +++ b/src/tesar/dispatch/brew_api.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import koji -from dispatch import get_compose_mapping, get_arguments, get_logging +from tesar.dispatch import get_compose_mapping, get_arguments, get_logging LOGGER = get_logging() ARGS = get_arguments() diff --git a/src/dispatch/copr_api.py b/src/tesar/dispatch/copr_api.py similarity index 97% rename from src/dispatch/copr_api.py rename to src/tesar/dispatch/copr_api.py index 4985177..14626ce 100644 --- a/src/dispatch/copr_api.py +++ b/src/tesar/dispatch/copr_api.py @@ -3,8 +3,8 @@ from copr.v3 import BuildProxy -from dispatch import dispatch_globals -from dispatch import get_arguments, get_compose_mapping, get_logging +from tesar.dispatch import dispatch_globals +from tesar.dispatch import get_arguments, get_compose_mapping, get_logging SESSION = BuildProxy(dispatch_globals.COPR_CONFIG) LOGGER = get_logging() diff --git a/src/dispatch/dispatch_globals.py b/src/tesar/dispatch/dispatch_globals.py similarity index 100% rename from src/dispatch/dispatch_globals.py rename to src/tesar/dispatch/dispatch_globals.py diff --git a/src/dispatch/tf_send_request.py b/src/tesar/dispatch/tf_send_request.py similarity index 98% rename from src/dispatch/tf_send_request.py rename to src/tesar/dispatch/tf_send_request.py index 433eb45..1b06ffb 100644 --- a/src/dispatch/tf_send_request.py +++ b/src/tesar/dispatch/tf_send_request.py @@ -6,13 +6,13 @@ import requests -from dispatch import ( +from tesar.dispatch import ( FormatText, get_arguments, get_config, get_datetime, ) -from dispatch.dispatch_globals import ( +from tesar.dispatch.dispatch_globals import ( ARTIFACT_BASE_URL, LATEST_TASKS_FILE, TESTING_FARM_ENDPOINT, diff --git a/src/report/__init__.py b/src/tesar/report/__init__.py similarity index 100% rename from src/report/__init__.py rename to src/tesar/report/__init__.py diff --git a/src/report/__main__.py b/src/tesar/report/__main__.py similarity index 99% rename from src/report/__main__.py rename to src/tesar/report/__main__.py index ceadfc0..70f517b 100644 --- a/src/report/__main__.py +++ b/src/tesar/report/__main__.py @@ -8,8 +8,8 @@ import requests from prettytable import PrettyTable -from dispatch import FormatText, get_arguments, get_logging -from dispatch.dispatch_globals import ( +from tesar.dispatch import FormatText, get_arguments, get_logging +from tesar.dispatch.dispatch_globals import ( ARTIFACT_BASE_URL, TESTING_FARM_ENDPOINT, LATEST_TASKS_FILE, diff --git a/tests/test_args.py b/tests/test_args.py index c5f1890..84d68c3 100644 --- a/tests/test_args.py +++ b/tests/test_args.py @@ -3,7 +3,7 @@ """ import pytest -from dispatch import get_arguments +from tesar.dispatch import get_arguments def test_cmd_args_are_appended():