f4pga/setup: optionally use .gitcommit
@@ -55,6 +55,11 @@ def get_requirements(file: Path) -> List[str]:
semver = "0.0.0"
version = None
+with (packagePath.parent / '.gitcommit').open("r") as rptr:
+ sha = rptr.read().strip()
+ if sha != '$Format:%h$':
+ version = f'{semver}-{sha}'
+
git = which('git')
if git is not None:
proc = run(['git', 'rev-parse', 'HEAD'], capture_output=True)
