Use symlink for hypexport
This commit is contained in:
parent
90f4587cc8
commit
af810eb325
4 changed files with 56 additions and 44 deletions
35
misc.org
Normal file
35
misc.org
Normal file
|
@ -0,0 +1,35 @@
|
|||
Various thoughts on organizing
|
||||
|
||||
* Importing external models
|
||||
- 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 alternative:
|
||||
symlinks in my_configuration and direct import?
|
||||
|
||||
+ mypy/pylint friendly
|
||||
? keeping a symlink to model.py is not much worse than hardcoding path. so it's ok I guess
|
||||
|
||||
* Thoughts on organizing imports
|
||||
- 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?...
|
||||
|
||||
Third way:
|
||||
import my_configuration.repos.hypexport.model as hypexport
|
||||
works, but MYPYPATH doesn't seem to be happy...
|
||||
ok, --namespace-packages solves it..
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue