diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 489d540..f0cb08b 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: include: - - { name: "3.8", python: "3.8", tox: py38 } - - { name: "3.8-ptpython", python: "3.8", tox: py38-ptpython } - - { name: "3.12", python: "3.12", tox: py312 } + - { name: "3.9", python: "3.9", tox: py39 } + - { name: "3.9-ptpython", python: "3.9", tox: py39-ptpython } + - { name: "3.13", python: "3.13", tox: py313 } steps: - uses: actions/checkout@v4.0.0 - uses: actions/setup-python@v5 @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.13" - name: Install pypa/build run: python -m pip install build - name: Build a binary wheel and a source tarball @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4.0.0 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.13" - run: python -m pip install tox - run: python -m tox -e lint publish-to-pypi: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 64a58b6..744c6a6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,11 @@ Changelog * *Backwards-incompatible*: Remove ``konch.__version__`` attribute. Use ``importlib.metadata.version("konch")`` instead. +Other changes: + +* Drop support for Python 3.8 (EOL). +* Test against Python 3.13. + 4.5.0 (2024-01-10) ------------------ diff --git a/docs/index.rst b/docs/index.rst index 1041472..f5ac115 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -48,12 +48,7 @@ Install/Upgrade $ pip install -U konch -Supports Python>=3.8. There are no external dependencies. - -.. note:: - - If you are using Python 2, ``konch<4.0`` will be installed with the - above command. +Supports Python>=3.9. There are no external dependencies. Usage ===== diff --git a/pyproject.toml b/pyproject.toml index 2f97c8a..6f51502 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,14 +10,14 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: System :: Shells", ] -requires-python = ">=3.8" +requires-python = ">=3.9" [project.scripts] konch = "konch:main" diff --git a/src/konch/__init__.py b/src/konch/__init__.py index a666eb7..b5232a8 100644 --- a/src/konch/__init__.py +++ b/src/konch/__init__.py @@ -77,7 +77,7 @@ class KonchrcChangedError(KonchrcNotAuthorizedError): class AuthFile: - def __init__(self, data: typing.Dict[str, str]) -> None: + def __init__(self, data: dict[str, str]) -> None: self.data = data def __repr__(self) -> str: @@ -142,7 +142,7 @@ def __enter__(self) -> "AuthFile": def __exit__( self, - exc_type: typing.Type[Exception], + exc_type: type[Exception], exc_value: Exception, exc_traceback: types.TracebackType, ) -> None: @@ -241,7 +241,7 @@ def _hide_formatter(context: Context) -> str: return "" -CONTEXT_FORMATTERS: typing.Dict[str, Formatter] = { +CONTEXT_FORMATTERS: dict[str, Formatter] = { "full": _full_formatter, "short": _short_formatter, "hide": _hide_formatter, @@ -426,7 +426,7 @@ class IPythonShell(Shell): def __init__( self, - ipy_extensions: typing.Optional[typing.List[str]] = None, + ipy_extensions: typing.Optional[list[str]] = None, ipy_autoreload: bool = False, ipy_colors: typing.Optional[str] = None, ipy_highlighting_style: typing.Optional[str] = None, @@ -535,7 +535,7 @@ def configure(repl): embed( globals=self.context, - history_filename=config_dir / "history", + history_filename=str(config_dir / "history"), vi_mode=self.ptpy_vi_mode, startup_paths=startup_paths, configure=configure, @@ -547,7 +547,7 @@ class PtIPythonShell(PtPythonShell): banner_template: str = "{text}\n{context}" def __init__( - self, ipy_extensions: typing.Optional[typing.List[str]] = None, *args, **kwargs + self, ipy_extensions: typing.Optional[list[str]] = None, *args, **kwargs ) -> None: self.ipy_extensions = ipy_extensions or [] PtPythonShell.__init__(self, *args, **kwargs) @@ -709,7 +709,7 @@ def start(self) -> None: return shell.start() -CONCHES: typing.List[str] = [ +CONCHES: list[str] = [ '"My conch told me to come save you guys."\n"Hooray for the magic conches!"', '"All hail the Magic Conch!"', '"Hooray for the magic conches!"', @@ -755,7 +755,7 @@ def __init__( self, context: typing.Optional[Context] = None, banner: typing.Optional[str] = None, - shell: typing.Type[Shell] = AutoShell, + shell: type[Shell] = AutoShell, prompt: typing.Optional[str] = None, output: typing.Optional[str] = None, context_format: str = "full", @@ -792,7 +792,7 @@ def update(self, d: typing.Mapping) -> None: # type: ignore self[key] = d[key] -SHELL_MAP: typing.Dict[str, typing.Type[Shell]] = { +SHELL_MAP: dict[str, type[Shell]] = { "ipy": IPythonShell, "ipython": IPythonShell, "bpy": BPythonShell, @@ -817,7 +817,7 @@ def update(self, d: typing.Mapping) -> None: # type: ignore def start( context: typing.Optional[typing.Mapping] = None, banner: typing.Optional[str] = None, - shell: typing.Type[Shell] = AutoShell, + shell: type[Shell] = AutoShell, prompt: typing.Optional[str] = None, output: typing.Optional[str] = None, context_format: str = "full", @@ -1163,7 +1163,7 @@ def deny_config(config_file: typing.Optional[Path] = None) -> typing.NoReturn: sys.exit(0) -def parse_args(argv: typing.Optional[typing.Sequence] = None) -> typing.Dict[str, str]: +def parse_args(argv: typing.Optional[typing.Sequence] = None) -> dict[str, str]: """Exposes the docopt command-line arguments parser. Return a dictionary of arguments. """ diff --git a/tox.ini b/tox.ini index 9a09cb1..5f8bb42 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint,py38-ptpython,py38,py39,py310,py311,py312,docs +envlist = lint,py39-ptpython,py38,py39,py310,py311,py312,py313,docs [testenv] extras = tests