diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f527ab..74c3c7b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,23 +14,21 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - name: Install Dependencies + - name: Type Checking run: | - uv pip install . ruff mypy pytest readme_renderer - uv pip list - - name: Type Checker + uvx --with . mypy ptpython + - name: Code formatting run: | - mypy ptpython - ruff check . - ruff format --check . - - name: Run Tests + uvx ruff check . + uvx ruff format --check . + - name: Unit test run: | - pytest tests/ + uvx --with . pytest tests/ - name: Validate README.md # Ensure that the README renders correctly (required for uploading to PyPI). run: | + uv pip install readme_renderer python -m readme_renderer README.rst > /dev/null diff --git a/ptpython/history_browser.py b/ptpython/history_browser.py index ae0ac03..72bc576 100644 --- a/ptpython/history_browser.py +++ b/ptpython/history_browser.py @@ -58,13 +58,15 @@ from .utils import if_mousedown if TYPE_CHECKING: + from typing_extensions import TypeAlias + from .python_input import PythonInput HISTORY_COUNT = 2000 __all__ = ["HistoryLayout", "PythonHistory"] -E = KeyPressEvent +E: TypeAlias = KeyPressEvent HELP_TEXT = """ This interface is meant to select multiple lines from the diff --git a/ptpython/key_bindings.py b/ptpython/key_bindings.py index d7bb575..48c5f5a 100644 --- a/ptpython/key_bindings.py +++ b/ptpython/key_bindings.py @@ -22,6 +22,8 @@ from .utils import document_is_multiline_python if TYPE_CHECKING: + from typing_extensions import TypeAlias + from .python_input import PythonInput __all__ = [ @@ -30,7 +32,7 @@ "load_confirm_exit_bindings", ] -E = KeyPressEvent +E: TypeAlias = KeyPressEvent @Condition