Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop python<=3.7 support #1877

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/layout/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not yet going to drop Python 3.7 yet. It's still too much in use today: https://pypistats.org/packages/prompt-toolkit
However, I'll cherry-pick this line, which works fine on 3.7 too.

)

#: Position of the cursor.
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/layout/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading