I am using an IDE so hacks like sys.path.append()
are somewhat undesirable, because static type checker can hardy see modules imported like this, so I was wondering what is a conventional way of referring to and managing your personal library of small utility scripts that are shared among a bunch of different projects. I can think of following:
- Using a
git submodule
that reffers to a git repo with 'personal utils shared among projects' - A symlink to a shared project, though it leads to duplicate code in github
- A proper package with setup and everything, but it seems like an overkill to me in terms of the amount of work required to maintain and sync versions between projects, even if that is just a folder with a
setup.py
script - Copy-pasting scripts between project
utils
subfolders on demand - that is what I do now, but it leads to some weird conflicting version of same utils in different projects
A bit of context: I am the only person who actively makes changes to these projects, so trickery with git might be okay, though other people might also need to have to run that code at some point in the future.