From 432878d2ae95415869f61f5f7049b5f2d3be6cf6 Mon Sep 17 00:00:00 2001 From: disinvite Date: Tue, 14 Nov 2023 16:57:29 -0500 Subject: [PATCH] Build isledecomp in GH actions, fix mypy complaint --- .github/workflows/build.yml | 9 +++++++-- tools/checkorder/requirements.txt | 2 +- tools/isledecomp/isledecomp/parser/parser.py | 6 +++++- tools/isledecomp/isledecomp/parser/util.py | 1 + tools/reccmp/requirements.txt | 3 ++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d02143c..d8f05f3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,12 +70,17 @@ jobs: path: legobin key: legobin + - name: Build isledecomp library + shell: bash + run: | + pip install tools/isledecomp + - name: Summarize Accuracy shell: bash run: | pip install -r tools/reccmp/requirements.txt - python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT - python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT + python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB ISLE | tee ISLEPROGRESS.TXT + python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB LEGO1 | tee LEGO1PROGRESS.TXT - name: Compare Accuracy With Current Master shell: bash diff --git a/tools/checkorder/requirements.txt b/tools/checkorder/requirements.txt index d6261da4..176352a6 100644 --- a/tools/checkorder/requirements.txt +++ b/tools/checkorder/requirements.txt @@ -1 +1 @@ --e ../isledecomp/ \ No newline at end of file +isledecomp \ No newline at end of file diff --git a/tools/isledecomp/isledecomp/parser/parser.py b/tools/isledecomp/isledecomp/parser/parser.py index 903e9064..483d4766 100644 --- a/tools/isledecomp/isledecomp/parser/parser.py +++ b/tools/isledecomp/isledecomp/parser/parser.py @@ -4,6 +4,7 @@ from enum import Enum from .util import ( CodeBlock, + OffsetMatch, is_blank_or_comment, match_offset_comment, is_exact_offset_comment, @@ -30,7 +31,10 @@ def find_code_blocks(stream: TextIO) -> List[CodeBlock]: blocks = [] - offset_match = None + offset_match = OffsetMatch(module=None, + address=None, + is_template=None, + is_stub=None) offset_comment = None function_sig = None start_line = None diff --git a/tools/isledecomp/isledecomp/parser/util.py b/tools/isledecomp/isledecomp/parser/util.py index 4bf53a97..61efa781 100644 --- a/tools/isledecomp/isledecomp/parser/util.py +++ b/tools/isledecomp/isledecomp/parser/util.py @@ -1,4 +1,5 @@ # C++ Parser utility functions and data structures +from __future__ import annotations # python <3.10 compatibility import re from collections import namedtuple diff --git a/tools/reccmp/requirements.txt b/tools/reccmp/requirements.txt index 31469c4c..36bffdc5 100644 --- a/tools/reccmp/requirements.txt +++ b/tools/reccmp/requirements.txt @@ -1,2 +1,3 @@ colorama -capstone \ No newline at end of file +capstone +isledecomp \ No newline at end of file