From c170fdadec8305cc473112bcfa2a800581337270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Tue, 28 May 2024 12:05:23 +0000 Subject: [PATCH 1/3] drop python<=3.7 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to https://endoflife.date/python python 3.7 has been EOSed 27 Jun 2023. Filter all code over `pyupgrade --py3.8-plus`. Signed-off-by: Tomasz Kłoczko --- src/prompt_toolkit/layout/screen.py | 2 +- src/prompt_toolkit/layout/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prompt_toolkit/layout/screen.py b/src/prompt_toolkit/layout/screen.py index 0f19f52a8..475f540d1 100644 --- a/src/prompt_toolkit/layout/screen.py +++ b/src/prompt_toolkit/layout/screen.py @@ -169,7 +169,7 @@ def __init__( #: Escape sequences to be injected. self.zero_width_escapes: defaultdict[int, defaultdict[int, str]] = defaultdict( - lambda: defaultdict(lambda: "") + lambda: defaultdict(str) ) #: Position of the cursor. diff --git a/src/prompt_toolkit/layout/utils.py b/src/prompt_toolkit/layout/utils.py index 373fe52a5..2e18558e5 100644 --- a/src/prompt_toolkit/layout/utils.py +++ b/src/prompt_toolkit/layout/utils.py @@ -5,7 +5,7 @@ from prompt_toolkit.formatted_text.base import OneStyleAndTextTuple if TYPE_CHECKING: - from typing_extensions import SupportsIndex + from typing import SupportsIndex __all__ = [ "explode_text_fragments", From 1421162d601dddc4580bbd205d6fc678d6022487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Tue, 28 May 2024 12:08:31 +0000 Subject: [PATCH 2/3] manual updates to remove python 3.7 support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomasz Kłoczko --- setup.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.py b/setup.py index ca2170ce4..50568c1a6 100755 --- a/setup.py +++ b/setup.py @@ -30,17 +30,13 @@ def get_version(package): package_dir={"": "src"}, package_data={"prompt_toolkit": ["py.typed"]}, install_requires=["wcwidth"], - # We require Python 3.7, because we need: - # - Context variables - PEP 567 - # - `asyncio.run()` - python_requires=">=3.7.0", + python_requires=">=3.8", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", From 287b6cb71b4e8cda2bbcc05d7f55b1f110ec9d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Tue, 28 May 2024 12:10:08 +0000 Subject: [PATCH 3/3] remove python 3.7 from CIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomasz Kłoczko --- .github/workflows/test.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eedbdd8ef..1155a38a1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -37,8 +37,7 @@ jobs: - name: Tests run: | coverage run -m pytest - - if: "matrix.python-version != '3.7'" - name: Mypy + - name: Mypy # Check whether the imports were sorted correctly. # When this fails, please run ./tools/sort-imports.sh run: |