diff --git a/grayskull/base/base_recipe.py b/grayskull/base/base_recipe.py index 6b3e77d97..73a441227 100644 --- a/grayskull/base/base_recipe.py +++ b/grayskull/base/base_recipe.py @@ -199,8 +199,8 @@ def _add_extra_section(self, maintainers: Optional[List] = None): if not self["extra"]: maintainers = maintainers if maintainers else [get_git_current_user()] self["extra"]["recipe-maintainers"].add_items(maintainers) - prefix = f"{Fore.LIGHTBLACK_EX}\n - {Fore.LIGHTMAGENTA_EX}" - print_msg(f"{Fore.LIGHTBLACK_EX}Maintainers:{prefix}{prefix.join(maintainers)}") + prefix = f"\n - {Fore.LIGHTMAGENTA_EX}" + print_msg(f"Maintainers:{prefix}{prefix.join(maintainers)}") def get_clean_yaml(self, recipe_yaml: CommentedMap) -> CommentedMap: result = self._clean_yaml(recipe_yaml) diff --git a/grayskull/base/extra.py b/grayskull/base/extra.py index 612091425..ff2bacb22 100644 --- a/grayskull/base/extra.py +++ b/grayskull/base/extra.py @@ -29,7 +29,7 @@ def get_git_current_user() -> str: f" Exception: {err}" ) print_msg( - f"{Fore.LIGHTBLACK_EX}Using default recipe maintainer:" + f"Using default recipe maintainer:" f" {Fore.LIGHTMAGENTA_EX}AddYourGitHubIdHere" ) return "AddYourGitHubIdHere" diff --git a/grayskull/license/discovery.py b/grayskull/license/discovery.py index 5c87cdada..25dfa66cf 100644 --- a/grayskull/license/discovery.py +++ b/grayskull/license/discovery.py @@ -11,7 +11,6 @@ from typing import List, Optional, Union import requests -from colorama import Fore from rapidfuzz import process from rapidfuzz.fuzz import token_set_ratio, token_sort_ratio from requests import HTTPError @@ -44,7 +43,7 @@ def get_all_licenses_from_spdx() -> List: raise HTTPError( f"It was not possible to communicate with spdx api.\n{response.text}" ) - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering license info from spdx.org ...") + print_msg("Recovering license info from spdx.org ...") return [ lic for lic in response.json()["licenses"] @@ -214,7 +213,7 @@ def search_license_api_github( """ github_url = _get_api_github_url(github_url, version) log.info(f"Github url: {github_url} - recovering license info") - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering license information from github...") + print_msg("Recovering license information from github...") response = requests.get(url=github_url, timeout=10) if response.status_code != 200: @@ -277,7 +276,7 @@ def search_license_repo( """ git_url = re.sub(r"/$", ".git", git_url) git_url = git_url if git_url.endswith(".git") else f"{git_url}.git" - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering license info from repository...") + print_msg("Recovering license info from repository...") tmp_dir = mkdtemp(prefix="gs-clone-repo-") try: check_output(_get_git_cmd(git_url, version, tmp_dir)) @@ -322,9 +321,7 @@ def get_license_type(path_license: str, default: Optional[str] = None) -> Option if find_apache: lic_type = find_apache[0] return f"Apache-{lic_type[0]}.{lic_type[1]}" - print_msg( - f"{Fore.LIGHTBLACK_EX}Matching license file with database from Grayskull..." - ) + print_msg("Matching license file with database from Grayskull...") all_licenses = get_all_licenses() licenses_text = list(map(itemgetter(1), all_licenses)) best_match = process.extract( diff --git a/grayskull/pypi/pypi.py b/grayskull/pypi/pypi.py index 7c891964f..35b757be6 100644 --- a/grayskull/pypi/pypi.py +++ b/grayskull/pypi/pypi.py @@ -94,7 +94,7 @@ def _get_sdist_metadata(self, sdist_url: str, name: str) -> dict: self.files_to_copy.append(path_pkg) log.debug(f"Unpacking {path_pkg} to {temp_folder}") shutil.unpack_archive(path_pkg, temp_folder) - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering information from setup.py") + print_msg("Recovering information from setup.py") with PyPi._injection_distutils(temp_folder) as metadata: metadata["sdist_path"] = temp_folder return metadata @@ -160,7 +160,7 @@ def _get_setup_cfg(source_path: str) -> dict: from setuptools.config import read_configuration log.debug(f"Started setup.cfg from {source_path}") - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering metadata from setup.cfg") + print_msg("Recovering metadata from setup.cfg") path_setup_cfg = list(Path(source_path).rglob("setup.cfg")) if not path_setup_cfg: return {} @@ -239,12 +239,12 @@ def __fake_distutils_setup(*args, **kwargs): try: core.setup = __fake_distutils_setup path_setup = str(path_setup) - print_msg(f"{Fore.LIGHTBLACK_EX}Executing injected distutils...") + print_msg("Executing injected distutils...") PyPi.__run_setup_py(path_setup, data_dist) if not data_dist or not data_dist.get("install_requires", None): print_msg( - f"{Fore.LIGHTBLACK_EX}No data was recovered from setup.py." - f" Forcing to execute the setup.py as script" + "No data was recovered from setup.py." + " Forcing to execute the setup.py as script" ) PyPi.__run_setup_py(path_setup, data_dist, run_py=True) yield data_dist @@ -520,12 +520,8 @@ def _get_metadata(self) -> dict: license_file = os.path.basename(license_metadata.path) self.files_to_copy.append(license_metadata.path) - print_msg( - f"{Fore.LIGHTBLACK_EX}License type: {Fore.LIGHTMAGENTA_EX}{license_name}" - ) - print_msg( - f"{Fore.LIGHTBLACK_EX}License file: {Fore.LIGHTMAGENTA_EX}{license_file}" - ) + print_msg(f"License type: {Fore.LIGHTMAGENTA_EX}{license_name}") + print_msg(f"License file: {Fore.LIGHTMAGENTA_EX}{license_file}") all_requirements = self._extract_requirements(metadata) all_requirements["host"] = solve_list_pkg_name( @@ -536,10 +532,9 @@ def _get_metadata(self) -> dict: ) def print_req(name, list_req: List): - prefix_req = f"{Fore.LIGHTBLACK_EX}\n - {Fore.LIGHTCYAN_EX}" + prefix_req = f"\n - {Fore.LIGHTCYAN_EX}" print_msg( - f"{Fore.LIGHTBLACK_EX}{name} requirements:" - f"{prefix_req}{prefix_req.join(list_req)}" + f"{name} requirements:" f"{prefix_req}{prefix_req.join(list_req)}" ) if all_requirements.get("build"): @@ -626,7 +621,7 @@ def _get_pypi_metadata(self, name, version: Optional[str] = None) -> dict: :param version: Package version :return: Pypi metadata """ - print_msg(f"{Fore.LIGHTBLACK_EX}Recovering metadata from pypi...") + print_msg("Recovering metadata from pypi...") if version: url_pypi = PyPi.URL_PYPI_METADATA.format(pkg_name=f"{name}/{version}") else: