Cześć, mam problem i nie wiem jak sobie elegancko z nim poradzić.
Mam w repo dwa katalogi z narzędziami, jeden zawiera większe narzędzie, drugi zbiór mniejszych. Chcę aby wszystkie skrypty korzystały ze wspólnej implementacji znajdującej się w katalogu common.
Użycie ..common.common_tool_1 nie działa. Dodanie root dira do PYTHONPATH pomaga, ale trochę śmierdzi hakiem. Znacie jakieś inne sposoby?
Didn’t really get to a good answer then. Right now I think how I would do it (but I have to admit that I would need to actually build it to understand all the subtilties and if it makes sense) is make a single package of this whole thing.
Hehe yeah pathlib makes this easier. However it still needs an “abspath” somewhere if you want to be able to also run it from the directory itself (ie if file doesn’t have any slash in it)