Skip to content

Commit 012bfc9

Browse files
Drop Python 3.8, given its' end of life, and no longer supported on GitHub CI. Also some typing fixes.
1 parent 4fd9777 commit 012bfc9

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
13+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Setup Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install Dependencies

ptpython/entry_points/run_ptpython.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,25 @@
3030
import os
3131
import pathlib
3232
import sys
33+
from importlib import metadata
3334
from textwrap import dedent
34-
from typing import IO
35+
from typing import Protocol
3536

3637
import appdirs
3738
from prompt_toolkit.formatted_text import HTML
3839
from prompt_toolkit.shortcuts import print_formatted_text
3940

4041
from ptpython.repl import PythonRepl, embed, enable_deprecation_warnings, run_config
4142

42-
try:
43-
from importlib import metadata # type: ignore
44-
except ImportError:
45-
import importlib_metadata as metadata # type: ignore
43+
__all__ = ["create_parser", "get_config_and_history_file", "run"]
4644

4745

48-
__all__ = ["create_parser", "get_config_and_history_file", "run"]
46+
class _SupportsWrite(Protocol):
47+
def write(self, s: str, /) -> object: ...
4948

5049

5150
class _Parser(argparse.ArgumentParser):
52-
def print_help(self, file: IO[str] | None = None) -> None:
51+
def print_help(self, file: _SupportsWrite | None = None) -> None:
5352
super().print_help()
5453
print(
5554
dedent(

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,21 @@
2727
package_data={"ptpython": ["py.typed"]},
2828
install_requires=[
2929
"appdirs",
30-
"importlib_metadata;python_version<'3.8'",
3130
"jedi>=0.16.0",
3231
# Use prompt_toolkit 3.0.43, because of `OneStyleAndTextTuple` import.
3332
"prompt_toolkit>=3.0.43,<3.1.0",
3433
"pygments",
3534
],
36-
python_requires=">=3.7",
35+
python_requires=">=3.8",
3736
classifiers=[
3837
"License :: OSI Approved :: BSD License",
3938
"Programming Language :: Python :: 3",
40-
"Programming Language :: Python :: 3.7",
4139
"Programming Language :: Python :: 3.8",
4240
"Programming Language :: Python :: 3.9",
4341
"Programming Language :: Python :: 3.10",
4442
"Programming Language :: Python :: 3.11",
4543
"Programming Language :: Python :: 3.12",
44+
"Programming Language :: Python :: 3.13",
4645
"Programming Language :: Python :: 3 :: Only",
4746
"Programming Language :: Python",
4847
],

0 commit comments

Comments
 (0)