Skip to content

Commit

Permalink
Support Python 3.9-3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Oct 14, 2024
1 parent f3a517d commit 97f3230
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: py38 }
- { name: "3.9-ptpython", python: "3.9", tox: py38-ptpython }
- { name: "3.13", python: "3.13", tox: py313 }
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v5
Expand All @@ -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
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: actions/[email protected]
- 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:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------
Expand Down
7 changes: 1 addition & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 11 additions & 11 deletions src/konch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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!"',
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 97f3230

Please sign in to comment.