core: proprely resolve class properties in make_config + add test

This commit is contained in:
Dima Gerasimov 2020-12-13 17:18:49 +00:00 committed by karlicoss
parent dda628e866
commit e81dddddf0
7 changed files with 50 additions and 48 deletions

View file

@ -11,23 +11,9 @@ After that, you can set config attributes:
export_path = '/path/to/twitter/exports'
config.twitter = user_config
"""
# TODO do I really need it?
# todo why do we bring this into scope? don't remember..
import my.config as config
from pathlib import Path
from typing import Union
def set_repo(name: str, repo: Union[Path, str]) -> None:
from .core.init import assign_module
from . common import import_from
r = Path(repo)
module = import_from(r.parent, name)
assign_module('my.config.repos', name, module)
# TODO set_repo is still useful, but perhaps move this thing away to core?
# TODO ok, I need to get rid of this, better to rely on regular imports
from .core import __NOT_HPI_MODULE__