Skip to content

Commit

Permalink
fix(main): move "_about" from __cli__.py to main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Apr 26, 2023
1 parent 892a3ce commit a379ac6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
14 changes: 1 addition & 13 deletions src/hyfi/__cli__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import hydra

from .env import HyfiConfig, __hydra_version_base__
from .main import DictConfig, HyFI, getLogger
from .main import DictConfig, HyFI, getLogger, _about

logger = getLogger(__name__)

Expand All @@ -14,18 +14,6 @@ def cmd(**args):
HyFI.run(args)


def _about(cfg):
pkg_name = cfg.about._package_name_
name = cfg.about.name
print()
for k, v in cfg.about.dict().items():
if k.startswith("_"):
continue
print(f"{k:11} : {v}")
if pkg_name:
print(f"\nExecute `{pkg_name} --help` to see what you can do with {name}")


def about(**args):
"""Print the about information"""
cfg = HyfiConfig(**args)
Expand Down
13 changes: 12 additions & 1 deletion src/hyfi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from omegaconf import DictConfig, ListConfig, SCMode

from .__cli__ import _about
from .env import DotEnvConfig, ProjectConfig, __global_config__, _to_config
from .hydra import (
DictKeyType,
Expand Down Expand Up @@ -71,6 +70,18 @@
logger = getLogger(__name__)


def _about(cfg):
pkg_name = cfg.about._package_name_
name = cfg.about.name
print()
for k, v in cfg.about.dict().items():
if k.startswith("_"):
continue
print(f"{k:11} : {v}")
if pkg_name:
print(f"\nExecute `{pkg_name} --help` to see what you can do with {name}")


class HyFI:
"""hyfi config primary class"""

Expand Down

0 comments on commit a379ac6

Please sign in to comment.