diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 85794f6..5b42d0e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,7 +23,15 @@ jobs: steps: - - uses: "actions/checkout@v4" + - name: "Checkout PR" + uses: "actions/checkout@v4" + if: github.event_name == 'pull_request_target' + with: + ref: refs/pull/${{ github.event.pull_request.number }}/merge + + - name: "Checkout Branch" + uses: "actions/checkout@v4" + if: github.event_name == 'push' - name: "Set up Python ${{ matrix.python-version }}" uses: "actions/setup-python@v5" diff --git a/Makefile b/Makefile index eb12d9f..f34c2e0 100644 --- a/Makefile +++ b/Makefile @@ -21,3 +21,6 @@ upload: check: ruff format --check ruff check + +reformat: + ruff format diff --git a/src/pyswip/core.py b/src/pyswip/core.py index ace53df..aa364cd 100644 --- a/src/pyswip/core.py +++ b/src/pyswip/core.py @@ -39,13 +39,11 @@ class PySwipError(Exception): - def __init__(self, message): super().__init__(message) class SwiPrologNotFoundError(PySwipError): - def __init__(self, message="SWI-Prolog not found"): super().__init__(message) @@ -188,7 +186,9 @@ def _find_swipl_windows(): # libswipl.dll must be in SWI_DIR/bin libswipl_path = os.path.join(swi_dir, "bin", libswipl) if not os.path.exists(libswipl_path): - raise SwiPrologNotFoundError(f"could not locate {libswipl} at {libswipl_path}") + raise SwiPrologNotFoundError( + f"could not locate {libswipl} at {libswipl_path}" + ) return libswipl_path, swi_dir raise SwiPrologNotFoundError diff --git a/tests/test_prolog.py b/tests/test_prolog.py index f938157..59fff35 100644 --- a/tests/test_prolog.py +++ b/tests/test_prolog.py @@ -25,6 +25,7 @@ """ Tests the Prolog class. """ + import os.path import unittest