From df589a54e070adefcd21f98e8cefb1a11f63e6e9 Mon Sep 17 00:00:00 2001 From: Catherine Date: Sat, 6 Apr 2024 07:56:13 +0000 Subject: [PATCH] _toolchain.yosys: fix amaranth-yosys version extractor. --- amaranth/_toolchain/yosys.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amaranth/_toolchain/yosys.py b/amaranth/_toolchain/yosys.py index 1c29f66..7bff19c 100644 --- a/amaranth/_toolchain/yosys.py +++ b/amaranth/_toolchain/yosys.py @@ -120,8 +120,8 @@ class _BuiltinYosys(YosysBinary): @classmethod def version(cls): version = importlib_metadata.version(cls.YOSYS_PACKAGE) - match = re.match(r"^(\d+)\.(\d+)(?:\.post(\d+))?", version) - return (int(match[1]), int(match[2]), int(match[3] or 0)) + match = re.match(r"^(\d+)\.(\d+)\.(?:\d+)(?:\.(\d+))?(?:\.post(\d+))?", version) + return (int(match[1]), int(match[2]), int(match[3] or 0), int(match[4] or 0)) @classmethod def data_dir(cls): diff --git a/pyproject.toml b/pyproject.toml index edd8f26..ca3fa14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ build-backend = "pdm.backend" [tool.pdm] # Remove this once we no longer support Python 3.8. -ignore_package_warnings = ["sphinx*"] +ignore_package_warnings = ["sphinx*", "alabaster"] [tool.pdm.build] # If amaranth 0.3 is checked out with git (e.g. as a part of a persistent editable install or