diff --git a/f4pga/setup.py b/f4pga/setup.py index b74ab39..263ad34 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -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)