Autolabel versions
ModischFabrications opened this issue · 8 comments
Track versions only in git, depend everything else on it.
- Git hook (pre commit?): If tag update version in file (simple
>>
?) - Python code loads variable from file
- Running instances can curl version file to warn with outdated answers.
https://pre-commit.com/ works as entry point
https://gitpython.readthedocs.io/en/stable/ is used to modify tags
can't tag in pre-commit, need post-commit at the earliest. Still can't really change python code from cli without risking integrity. -> python to git needed instead
won't work. Commit needs to exist to be tagged, pre-push is too late as it won't allow "staging" the tag as well. post-commit needed, see pre-commit/pre-commit#1411
Oh, btw, pycharm push won't respect pipenv shell, see pre-commit/pre-commit#1412
Use a common source for both versions instead?
- version as text file, read by app on startup
- fetch version file in github repo by running app to check internal version (would need requests or something similar, see #37 for some references)
- write script that increases version in file and tags git commit
Git hook reference: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
GitPython could push the new tag by itself, but pushing inside a push hook sounds like a really stupid idea, especially since the inner push tag refers to an outer push commit.
https://youtrack.jetbrains.com/issue/PY-12988 should make these prefixes obsolete