diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21a0ee4..2bfe6e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + path: keybinds - name: Checkout mods_base uses: actions/checkout@v6 @@ -39,16 +41,18 @@ jobs: python-version: ">=3.13" - name: Generate stubs - working-directory: .pyunrealsdk run: | + cd .pyunrealsdk pip install -r stubgen/requirements.txt python -m stubgen WILLOW ../.stubs - - - name: Add stubs to pyproject - run: sed -i 's/# CI ADD STUB PATH HERE/stubPath = ".stubs"\nreportMissingModuleSource = false/' pyproject.toml + cd .. + rm -r .pyunrealsdk + sed -i 's/# CI ADD STUB PATH HERE/stubPath = "..\/.stubs"\nextraPaths = ["..\/"]\nreportMissingModuleSource = false/' keybinds/pyproject.toml - name: Run pyright uses: jakebailey/pyright-action@v3 + with: + working-directory: ${{ github.workspace }}/keybinds/ ruff: runs-on: ubuntu-latest @@ -56,6 +60,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + path: keybinds - name: Checkout mods_base uses: actions/checkout@v6 @@ -76,20 +82,21 @@ jobs: python-version: ">=3.13" - name: Generate stubs - working-directory: .pyunrealsdk run: | + cd .pyunrealsdk pip install -r stubgen/requirements.txt python -m stubgen WILLOW ../.stubs cd .. rm -r .pyunrealsdk - - - name: Add stubs to pyproject - run: sed -i 's/# CI ADD STUB PATH HERE/stubPath = ".stubs"\nreportMissingModuleSource = false/' pyproject.toml + sed -i 's/# CI ADD STUB PATH HERE/stubPath = "..\/.stubs"\nextraPaths = ["..\/"]\nreportMissingModuleSource = false/' keybinds/pyproject.toml - name: Run Ruff Linting uses: astral-sh/ruff-action@v4.0.0 + with: + src: keybinds/ - name: Run Ruff Formatting uses: astral-sh/ruff-action@v4.0.0 with: + src: keybinds/ args: format --check diff --git a/__init__.py b/__init__.py index 1173369..140d94c 100644 --- a/__init__.py +++ b/__init__.py @@ -1,15 +1,13 @@ from functools import wraps from typing import TYPE_CHECKING, Any -from unrealsdk.hooks import Type - from mods_base import EInputEvent, KeybindType, hook from mods_base.mod_list import base_mod +from unrealsdk.hooks import Type if TYPE_CHECKING: - from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct - from mods_base.keybinds import KeybindCallback_Event, KeybindCallback_NoArgs + from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct __all__: tuple[str, ...] = ( "__author__",