From 7032eec15e968b217efeb5184f66c412c6346667 Mon Sep 17 00:00:00 2001 From: Camila Alvarez Date: Mon, 31 Mar 2025 20:14:34 -0300 Subject: [PATCH] Turn relative imports to absolute imports Some modules were considering relative imports to other parts of the client. This works on a local enviroments but fails when installing the client using pip or packaging the code Signed-off-by: Camila Alvarez --- kcidev/libs/files.py | 3 ++- kcidev/libs/git_repo.py | 3 +-- kcidev/subcommands/results/__init__.py | 11 ++++++----- kcidev/subcommands/results/hardware.py | 7 ++++--- kcidev/subcommands/results/parser.py | 4 ++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/kcidev/libs/files.py b/kcidev/libs/files.py index a6c2ed7..9450110 100644 --- a/kcidev/libs/files.py +++ b/kcidev/libs/files.py @@ -3,7 +3,8 @@ import re import requests -from libs.common import kci_err + +from kcidev.libs.common import kci_err INVALID_FILE_CHARS = re.compile(r'[\\/:"*?<>|]+') diff --git a/kcidev/libs/git_repo.py b/kcidev/libs/git_repo.py index cb00aef..53fa300 100644 --- a/kcidev/libs/git_repo.py +++ b/kcidev/libs/git_repo.py @@ -3,9 +3,8 @@ import subprocess import urllib -from libs.dashboard import dashboard_fetch_tree_list - from kcidev.libs.common import * +from kcidev.libs.dashboard import dashboard_fetch_tree_list def repository_url_cleaner(url): diff --git a/kcidev/subcommands/results/__init__.py b/kcidev/subcommands/results/__init__.py index a8dd225..fa23b58 100644 --- a/kcidev/subcommands/results/__init__.py +++ b/kcidev/subcommands/results/__init__.py @@ -3,7 +3,8 @@ from functools import wraps import click -from libs.dashboard import ( + +from kcidev.libs.dashboard import ( dashboard_fetch_boots, dashboard_fetch_build, dashboard_fetch_builds, @@ -11,15 +12,15 @@ dashboard_fetch_test, dashboard_fetch_tests, ) -from libs.git_repo import set_giturl_branch_commit -from subcommands.results.hardware import hardware -from subcommands.results.options import ( +from kcidev.libs.git_repo import set_giturl_branch_commit +from kcidev.subcommands.results.hardware import hardware +from kcidev.subcommands.results.options import ( builds_and_tests_options, common_options, results_display_options, single_build_and_test_options, ) -from subcommands.results.parser import ( +from kcidev.subcommands.results.parser import ( cmd_builds, cmd_list_trees, cmd_single_build, diff --git a/kcidev/subcommands/results/hardware.py b/kcidev/subcommands/results/hardware.py index 7e83a96..15f7134 100644 --- a/kcidev/subcommands/results/hardware.py +++ b/kcidev/subcommands/results/hardware.py @@ -1,10 +1,11 @@ import click -from libs.dashboard import ( + +from kcidev.libs.dashboard import ( dashboard_fetch_hardware_list, dashboard_fetch_hardware_summary, ) -from subcommands.results.options import results_display_options -from subcommands.results.parser import cmd_hardware_list, cmd_summary +from kcidev.subcommands.results.options import results_display_options +from kcidev.subcommands.results.parser import cmd_hardware_list, cmd_summary @click.group(chain=True, help="Get hardware related information from the dashboard") diff --git a/kcidev/subcommands/results/parser.py b/kcidev/subcommands/results/parser.py index 35fc82b..9b25a10 100644 --- a/kcidev/subcommands/results/parser.py +++ b/kcidev/subcommands/results/parser.py @@ -3,10 +3,10 @@ import requests import yaml -from libs.dashboard import dashboard_fetch_tree_list -from libs.files import download_logs_to_file from kcidev.libs.common import * +from kcidev.libs.dashboard import dashboard_fetch_tree_list +from kcidev.libs.files import download_logs_to_file def print_summary(type, n_pass, n_fail, n_inconclusive):