From 6094c2c2ef9682e19114555b33ce4e1b69428ae6 Mon Sep 17 00:00:00 2001 From: Mark Gillard Date: Sun, 10 Sep 2023 14:59:18 +0300 Subject: [PATCH] fixed #33 --- .github/workflows/ci.yaml | 4 +++- .gitignore | 1 + CHANGELOG.md | 6 +++++- src/poxy/doxygen.py | 7 +++++-- src/poxy/main.py | 11 ++++++++++- src/poxy/version.txt | 2 +- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d79c13..fb5515d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,9 +111,10 @@ jobs: cd "${{ github.workspace }}/repo" sudo python3 -m pip install --upgrade . - - name: Print poxy help + - name: Print poxy help and version run: | poxy --help + poxy --version - name: Build and install doxygen from source if: ${{ matrix.doxygen_tag != 'none' }} @@ -132,6 +133,7 @@ jobs: run: | sudo apt -y install doxygen doxygen --version + poxy --doxygen-version - name: Run poxy on test_project run: | diff --git a/.gitignore b/.gitignore index af408fa..7bd1fb2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # test outputs tests/**/html/ tests/**/xml/ +tests/**/latex/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/CHANGELOG.md b/CHANGELOG.md index d2054da..fa1f722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog +## v0.13.9 - 2023-09-10 + +- fixed crash on Doxygen <= 1.8.17 (#33) (@tim-janik) + ## v0.13.8 - 2023-09-09 -- fixed regression for Python <= 3.8 (#32) (@timjanik) +- fixed regression for Python <= 3.8 (#32) (@tim-janik) ## v0.13.7 - 2023-08-17 diff --git a/src/poxy/doxygen.py b/src/poxy/doxygen.py index e7634c7..3875982 100644 --- a/src/poxy/doxygen.py +++ b/src/poxy/doxygen.py @@ -9,6 +9,7 @@ import itertools import os +import re import shutil import subprocess from typing import Tuple @@ -118,7 +119,7 @@ def version() -> Tuple[int, int, int]: ret = proc.stdout.strip() if proc.stdout is not None else '' if not ret 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])(\s.+?)?', ret, flags=re.I) + 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])) return version.val @@ -171,7 +172,9 @@ def cleanup(self): if not self.__dirty: return if 1: - log(self.__logger, rf'Invoking doxygen to clean doxyfile') + log(self.__logger, rf'Cleaning doxyfile') + # https://github.com/marzer/poxy/issues/33: + self.__text = re.sub(r'_ENCODING\s*=\s*"([^"]*?)"', r'_ENCODING = \1', self.__text) result = subprocess.run( [str(path()), r'-s', r'-u', r'-'], check=True, diff --git a/src/poxy/main.py b/src/poxy/main.py index d97591b..d9023db 100644 --- a/src/poxy/main.py +++ b/src/poxy/main.py @@ -14,7 +14,7 @@ import sys import zipfile -from . import css, emoji, graph, mcss, paths +from . import css, doxygen, emoji, graph, mcss, paths from .run import run from .schemas import SchemaError from .utils import * @@ -217,6 +217,7 @@ def main(invoker=True): make_boolean_optional_arg(args, r'update-fonts', default=None, help=argparse.SUPPRESS) args.add_argument(r'--update-emoji', action=r'store_true', help=argparse.SUPPRESS) # args.add_argument(r'--update-tests', action=r'store_true', help=argparse.SUPPRESS) # + args.add_argument(r'--doxygen-version', action=r'store_true', help=argparse.SUPPRESS) # args.add_argument( r'--update-mcss', type=Path, default=None, metavar=r'', help=argparse.SUPPRESS, dest=r'mcss' ) # @@ -235,6 +236,14 @@ def main(invoker=True): print(VERSION_STRING) return + # -------------------------------------------------------------- + # --doxygen-version + # -------------------------------------------------------------- + + if args.doxygen_version: + print(doxygen.version_string()) + return + # -------------------------------------------------------------- # --where # -------------------------------------------------------------- diff --git a/src/poxy/version.txt b/src/poxy/version.txt index 94cade1..9c356d5 100644 --- a/src/poxy/version.txt +++ b/src/poxy/version.txt @@ -1 +1 @@ -0.13.8 +0.13.9