Basically this https://setuptools-scm.readthedocs.io/en/stable/usage/#git-archives + adjust tag matching for leading-v.