From badb2012a702438d4eb1c3254e8e93fa669da545 Mon Sep 17 00:00:00 2001 From: Marco Enrico Piras Date: Wed, 25 Sep 2024 12:47:07 +0200 Subject: [PATCH 1/2] fix: :ambulance: fix version parser --- rocrate_validator/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rocrate_validator/utils.py b/rocrate_validator/utils.py index a128722f..552b3a51 100644 --- a/rocrate_validator/utils.py +++ b/rocrate_validator/utils.py @@ -52,7 +52,7 @@ def run_git_command(command: list[str]) -> Optional[str]: import subprocess try: - output = subprocess.check_output(command).decode().strip() + output = subprocess.check_output(command, stderr=subprocess.DEVNULL).decode().strip() return output except Exception as e: if logger.isEnabledFor(logging.DEBUG): @@ -88,7 +88,13 @@ def get_commit_distance(tag: Optional[str] = None) -> int: """ if not tag: tag = get_last_tag() - return int(run_git_command(['git', 'rev-list', '--count', 'HEAD' if not tag else f"{tag}..HEAD"])) + try: + return int(run_git_command(['git', 'rev-list', '--count', f"{tag}..HEAD"])) + except Exception as e: + if logger.isEnabledFor(logging.DEBUG): + logger.debug(e) + + return 0 def get_last_tag() -> str: From b101cd9c072fd6a3a20e78d511b270f292a7a70a Mon Sep 17 00:00:00 2001 From: Marco Enrico Piras Date: Wed, 25 Sep 2024 12:54:29 +0200 Subject: [PATCH 2/2] =?UTF-8?q?build(core):=20=F0=9F=94=96=20update=20vers?= =?UTF-8?q?ion=20number=20to=200.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 91b6ea65..c523f4bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "roc-validator" -version = "0.2.0" +version = "0.2.1" description = "A Python package to validate RO-Crates" authors = [ "Marco Enrico Piras ",