Use symlink for hypexport

This commit is contained in:
Dima Gerasimov 2019-10-08 21:06:50 +01:00
parent 90f4587cc8
commit af810eb325
4 changed files with 56 additions and 44 deletions

View file

@ -1,47 +1,8 @@
from functools import lru_cache
from pathlib import Path
from . import paths
from .common import import_file
# from . import my_configuration # import hypexport_model as hypexport
import my_configuration.hypexport_model as hypexport
"""
First way:
import my_configuration.hypexport_model as hypexport
works, but my_configuration is scattered across the repository?
Second way:
from . import my_configuration?
doesn't seem to work with subpackages?
right, perhaps symlinking is a good idea after all?...
"""
"""
First alternative:
@lru_cache()
def hypexport():
... import_file
---
doesn't really work either..
hypexport = import_file(Path(paths.hypexport.repo) / 'model.py')
---
+ TODO check pytest friendliness if some paths are missing? Wonder if still easier to control by manually excluding...
- not mypy/pylint friendly at all?
Second:
symlinks and direct import?
+ TODO
- TODO ????
? keeping a symlink to model.py is not much worse than harding path. so it's ok I guess
"""
from my_configuration import paths
import my_configuration.repos.hypexport.model as hypexport
def get_model() -> hypexport.Model:
export_dir = Path(paths.hypexport.export_dir)