From 1712ba237e2aefa99b645ae3b7f240334c7a17a5 Mon Sep 17 00:00:00 2001 From: jptomoya <4786564+jptomoya@users.noreply.github.com> Date: Sun, 18 Feb 2024 13:50:37 +0900 Subject: [PATCH 1/4] Update actions feature versions since Node.js deprecated warnings --- .github/workflows/test-on-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-on-pr.yml b/.github/workflows/test-on-pr.yml index 451a723..5fba3cf 100644 --- a/.github/workflows/test-on-pr.yml +++ b/.github/workflows/test-on-pr.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies From 58228da4b0bfc55d8ead29b33cd771a0e623be90 Mon Sep 17 00:00:00 2001 From: jptomoya <4786564+jptomoya@users.noreply.github.com> Date: Sun, 18 Feb 2024 13:55:20 +0900 Subject: [PATCH 2/4] Test across Python versions 3.8 or later --- .github/workflows/test-on-pr.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-on-pr.yml b/.github/workflows/test-on-pr.yml index 5fba3cf..7b14679 100644 --- a/.github/workflows/test-on-pr.yml +++ b/.github/workflows/test-on-pr.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python application +name: Python Test on: [push, pull_request] @@ -9,17 +9,22 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: | - python -m unittest + echo '```' >> $GITHUB_STEP_SUMMARY + python -m unittest &>> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY From 596342a552bb56bef456ab11e3deca4eeeedf90e Mon Sep 17 00:00:00 2001 From: jptomoya <4786564+jptomoya@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:52:51 +0900 Subject: [PATCH 3/4] Update test-on-pr.yml Indicate platform name clearly --- .github/workflows/test-on-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-pr.yml b/.github/workflows/test-on-pr.yml index 7b14679..ea6327c 100644 --- a/.github/workflows/test-on-pr.yml +++ b/.github/workflows/test-on-pr.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python Test +name: Python Test (Ubuntu) on: [push, pull_request] From 2666e110a95b8b1f6ada8deeeaa8db5190fb51b1 Mon Sep 17 00:00:00 2001 From: Yudai Fujiwara Date: Mon, 19 Feb 2024 20:51:05 +0900 Subject: [PATCH 4/4] Update regex --- ptrlib/arch/arm/disassembler.py | 6 +++--- ptrlib/arch/intel/disassembler.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ptrlib/arch/arm/disassembler.py b/ptrlib/arch/arm/disassembler.py index 928c410..af0611d 100644 --- a/ptrlib/arch/arm/disassembler.py +++ b/ptrlib/arch/arm/disassembler.py @@ -64,11 +64,11 @@ def disassemble_arm(code: bytes, return output = [] - r = re.findall(rb"([0-9a-f]+):\s+[0-9a-f]+\s+(.+)", + r = re.findall(r"([0-9a-f]+):\s+[0-9a-f]+\s+(.+)", stdout.decode()) for addr, op in r: - op = re.sub("\s+", " ", op.strip()) - op = re.sub("//.+", "", op).strip() + op = re.sub(r"\s+", " ", op.strip()) + op = re.sub(r"//.+", "", op).strip() output.append((int(addr, 16), op)) os.unlink(fname_bin) diff --git a/ptrlib/arch/intel/disassembler.py b/ptrlib/arch/intel/disassembler.py index 4009f6d..a0d99e0 100644 --- a/ptrlib/arch/intel/disassembler.py +++ b/ptrlib/arch/intel/disassembler.py @@ -59,10 +59,10 @@ def disassemble_intel(code: bytes, return output = [] - r = re.findall(rb"([0-9a-f]+):\s+([0-9a-f]{2}\s)+\s+(.+)", + r = re.findall(r"([0-9a-f]+):\s+([0-9a-f]{2}\s)+\s+(.+)", stdout.decode()) for addr, _, op in r: - op = re.sub("\s+", " ", op.strip()) + op = re.sub(r"\s+", " ", op.strip()) output.append((int(addr, 16), op)) os.unlink(fname_bin)