Skip to content

Commit

Permalink
added doxygen version to bug report metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Sep 10, 2023
1 parent 6094c2c commit 29cbf73
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# test outputs
# misc outputs
tests/**/html/
tests/**/xml/
tests/**/latex/
poxy_bug_report.zip

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
21 changes: 14 additions & 7 deletions src/poxy/doxygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,22 @@ def test_path(p):
return path.val


def version() -> Tuple[int, int, int]:
if not hasattr(version, "val"):
def raw_version_string() -> str:
if not hasattr(raw_version_string, "val"):
proc = subprocess.run([str(path()), r'--version'], capture_output=True, encoding=r'utf-8', check=True)
ret = proc.stdout.strip() if proc.stdout is not None else ''
if not ret and proc.stderr.strip():
val = proc.stdout.strip() if proc.stdout is not None else ''
if not val and proc.stderr.strip():
raise Error(rf'doxygen exited with error: {proc.stderr.strip()}')
ret = re.fullmatch(r'^\s*v?\s*([0-9]+)\s*[.]\s*([0-9]+)\s*[.]\s*([0-9]+)(?:[^0-9].*)?$', ret, flags=re.I)
assert ret
version.val = (int(ret[1]), int(ret[2]), int(ret[3]))
setattr(raw_version_string, 'val', val)
return raw_version_string.val


def version() -> Tuple[int, int, int]:
if not hasattr(version, "val"):
val = raw_version_string()
val = re.fullmatch(r'^\s*v?\s*([0-9]+)\s*[.]\s*([0-9]+)\s*[.]\s*([0-9]+)(?:[^0-9].*)?$', val, flags=re.I)
assert val
setattr(version, 'val', (int(val[1]), int(val[2]), int(val[3])))
return version.val


Expand Down
4 changes: 4 additions & 0 deletions src/poxy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def bug_report():
f.write(f'version: {VERSION_STRING}\n')
f.write(f'args: {bug_report_args}\n')
f.write(f'returncode: {result.returncode}\n')
try:
f.write(f'doxygen: {doxygen.raw_version_string()}\n')
except:
f.write(f'doxygen: --version failed\n')

# zip file
print(r'Zipping files')
Expand Down

0 comments on commit 29cbf73

Please sign in to comment.