Skip to content

Commit

Permalink
fix: replace print with print_info
Browse files Browse the repository at this point in the history
  • Loading branch information
MoskalenkoViktor committed Feb 19, 2024
1 parent b8c3e48 commit 19e5b48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions checker/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from collections.abc import Sequence
from pathlib import Path

from checker.utils import print_info

from .base import PluginABC, PluginOutput # noqa: F401


Expand Down Expand Up @@ -38,12 +40,12 @@ def load_plugins(
] # add local plugins first

# force load plugins
print("Loading plugins...")
print_info("Loading plugins...")

Check warning on line 43 in checker/plugins/__init__.py

View check run for this annotation

Codecov / codecov/patch

checker/plugins/__init__.py#L43

Added line #L43 was not covered by tests
for module_info in pkgutil.iter_modules([str(path) for path in search_directories]):
if module_info.name == "__init__":
continue
if verbose:
print(f"- {module_info.name} from {module_info.module_finder.path}") # type: ignore[union-attr]
print_info(f"- {module_info.name} from {module_info.module_finder.path}") # type: ignore[union-attr]

Check warning on line 48 in checker/plugins/__init__.py

View check run for this annotation

Codecov / codecov/patch

checker/plugins/__init__.py#L48

Added line #L48 was not covered by tests

spec = module_info.module_finder.find_spec(fullname=module_info.name) # type: ignore[call-arg]
if spec is None:
Expand All @@ -60,5 +62,5 @@ def load_plugins(
for subclass in get_all_subclasses(PluginABC): # type: ignore[type-abstract]
plugins[subclass.name] = subclass
if verbose:
print(f"Loaded: {', '.join(plugins.keys())}")
print_info(f"Loaded: {', '.join(plugins.keys())}")

Check warning on line 65 in checker/plugins/__init__.py

View check run for this annotation

Codecov / codecov/patch

checker/plugins/__init__.py#L65

Added line #L65 was not covered by tests
return plugins
8 changes: 4 additions & 4 deletions checker/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ def validate(self) -> None:
outputs: dict[str, PipelineStageResult] = {}

# validate global pipeline (only default params and variables available)
print("- global pipeline...")
print_info("- global pipeline...")

Check warning on line 128 in checker/tester.py

View check run for this annotation

Codecov / codecov/patch

checker/tester.py#L128

Added line #L128 was not covered by tests
global_variables = self._get_global_pipeline_parameters(Path(), tasks)
context = self._get_context(global_variables, None, outputs, self.default_params, None)
self.global_pipeline.validate(context, validate_placeholders=True)
print(" ok")
print_info(" ok")

Check warning on line 132 in checker/tester.py

View check run for this annotation

Codecov / codecov/patch

checker/tester.py#L132

Added line #L132 was not covered by tests

for task in tasks:
# validate task with global + task-specific params
print(f"- task {task.name} pipeline...")
print_info(f"- task {task.name} pipeline...")

Check warning on line 136 in checker/tester.py

View check run for this annotation

Codecov / codecov/patch

checker/tester.py#L136

Added line #L136 was not covered by tests

# create task context
task_variables = self._get_task_pipeline_parameters(task)
Expand All @@ -150,7 +150,7 @@ def validate(self) -> None:
self.task_pipeline.validate(context, validate_placeholders=True)
self.report_pipeline.validate(context, validate_placeholders=True)

print(" ok")
print_info(" ok")

Check warning on line 153 in checker/tester.py

View check run for this annotation

Codecov / codecov/patch

checker/tester.py#L153

Added line #L153 was not covered by tests

def run(
self,
Expand Down

0 comments on commit 19e5b48

Please sign in to comment.