f4pga: add pyproject.toml

Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
Unai Martinez-Corral 2022-08-15 04:38:10 +02:00
parent 30eb91feed
commit e709908bcb
2 changed files with 4 additions and 2 deletions

2
f4pga/pyproject.toml Normal file
View File

@ -0,0 +1,2 @@
[tool.black]
line-length = 120

View File

@ -55,13 +55,13 @@ version = None
with (packagePath.parent / '.gitcommit').open("r") as rptr:
sha = rptr.read().strip()
if sha != '$Format:%h$':
version = f'{semver}-{sha}'
version = f'{semver}+{sha}'
git = which('git')
if git is not None:
proc = run(['git', 'rev-parse', 'HEAD'], capture_output=True)
if proc.returncode == 0:
version = f'{semver}-{proc.stdout.decode("utf8")[0:8]}'
version = f'{semver}+{proc.stdout.decode("utf8")[0:8]}'
if version is None:
version = semver