Skip to content

Commit

Permalink
files() not needed, write some more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Dec 9, 2024
1 parent 34cd1bd commit deea1e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build_utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@

for gitcmd in gits:
try:
print(f"Trying {gitcmd} ...")
proc = subprocess.run([gitcmd, "describe", "--tags", "--dirty"],
capture_output=True, check=True, text=True)
except subprocess.CalledProcessError as err:
print(f"Tried {gitcmd}, returned: {err}", file=sys.stderr)
print(f"Stdout: '{err.stdout.strip()}'", file=sys.stderr)
print(f"Stdout: '{err.stderr.strip()}'", file=sys.stderr)
print(f"Stderr: '{err.stderr.strip()}'", file=sys.stderr)
continue

version, *dirty = proc.stdout.strip().split("-")
Expand All @@ -53,6 +54,7 @@
break

else: # Can't use git
print(f"All git implementations failed, reading version file")

Check warning on line 57 in build_utils/version.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

build_utils/version.py#L57

Using an f-string that does not have any interpolated variables
version = version_file.read_text().split("=")[1].strip('"\n ')

match COMMAND:
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('euphonic',
'c',
version: run_command('python', files('build_utils/version.py'), check: true).stdout().strip(),
version: run_command('python', 'build_utils/version.py', check: true).stdout().strip(),
meson_version: '>=1.6',
)

Expand Down

0 comments on commit deea1e1

Please sign in to comment.