Skip to content

Commit

Permalink
Drop Python 3.8 (#323)
Browse files Browse the repository at this point in the history
# Problem

Python 3.8 reached end-of-life on October 7th, 2024 (see devguide.python.org, Status of Python Versions, [Unsupported versions](https://devguide.python.org/versions/#:~:text=Release%20manager-,3.8,-PEP%20569))

# Changes

## Drop Python 3.8

## Ruff fixes via ruff 0.8.4

```console
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
```

## cihai: Bump minimum version to 0.35.0 (#323)

Requires Python 3.9.

Updates unihan-etl to 0.37.0, which also requires Python 3.9.
  • Loading branch information
tony authored Dec 21, 2024
2 parents ca341ba + b3844f9 commit 4d8140e
Show file tree
Hide file tree
Showing 8 changed files with 488 additions and 323 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.13']
python-version: ['3.9', '3.13']
steps:
- uses: actions/checkout@v4

Expand Down
24 changes: 24 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,30 @@ You can test the unpublished version of cihai-cli before its released, see

<!-- Maintainers, insert changes / features for the next release here -->

### Breaking changes

- Drop Python 3.8 (#323)

The minimum version of Python in this and future releases is Python 3.9.

Python 3.8 reached end-of-life status on October 7th, 2024 (see PEP 569).

- cihai: Bump minimum version to 0.35.0 (#323)

Requires Python 3.9.

Updates unihan-etl to 0.37.0, which also requires Python 3.9.

### Development

- Aggressive automated lint fixes via `ruff` (#323)

via ruff v0.8.4, all automated lint fixes, including unsafe and previews were applied for Python 3.9:

```sh
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
```

## cihai-cli 0.29.0 (2024-11-26)

_Maintenance only, no bug fixes, or new features_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ $ cd cihai-cli
- [Quickstart](https://cihai-cli.git-pull.com/quickstart.html)
- Python [API](https://cihai-cli.git-pull.com/api.html)
- [2017 roadmap](https://cihai.git-pull.com/design-and-planning/2017/spec.html)
- Python support: >= 3.8, pypy
- Python support: >= 3.9, pypy
- Source: <https://github.com/cihai/cihai-cli>
- Docs: <https://cihai-cli.git-pull.com>
- Changelog: <https://cihai-cli.git-pull.com/history.html>
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sys.path.insert(0, str(cwd / "_ext"))

# package data
about: t.Dict[str, str] = {}
about: dict[str, str] = {}
with (src_root / "cihai_cli" / "__about__.py").open() as fp:
exec(fp.read(), about)

Expand Down Expand Up @@ -71,8 +71,8 @@
html_css_files = ["css/custom.css"]
html_favicon = "_static/favicon.ico"
html_theme = "furo"
html_theme_path: t.List[str] = []
html_theme_options: t.Dict[str, t.Union[str, t.List[t.Dict[str, str]]]] = {
html_theme_path: list[str] = []
html_theme_options: dict[str, t.Union[str, list[dict[str, str]]]] = {
"light_logo": "img/cihai.svg",
"dark_logo": "img/cihai.svg",
"footer_icons": [
Expand Down Expand Up @@ -147,7 +147,7 @@
}


def linkcode_resolve(domain: str, info: t.Dict[str, str]) -> t.Union[None, str]:
def linkcode_resolve(domain: str, info: dict[str, str]) -> t.Union[None, str]:
"""
Determine the URL corresponding to Python object.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cihai-cli"
version = "0.29.0"
description = "Command line frontend for the cihai CJK language library"
requires-python = ">=3.8,<4.0"
requires-python = ">=3.9,<4.0"
license = { text = "MIT" }
authors = [
{name = "Tony Narlock", email = "tony@git-pull.com"}
Expand All @@ -14,7 +14,6 @@ classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -53,7 +52,7 @@ include = [
{ path = "tests", format = "sdist" },
]
dependencies = [
"cihai~=0.34.0",
"cihai~=0.35.0",
"PyYAML"
]

Expand Down Expand Up @@ -141,11 +140,12 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.mypy]
strict = true
python_version = "3.9"
files = [
"src/",
"tests/",
]
strict = true

[[tool.mypy.overrides]]
module = [
Expand All @@ -154,7 +154,7 @@ module = [
ignore_missing_imports = true

[tool.ruff]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
select = [
Expand Down
2 changes: 1 addition & 1 deletion src/cihai_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CLILoadNamespace(argparse.Namespace):
log_file: t.Optional[str]


def cli(_args: t.Optional[t.List[str]] = None) -> None:
def cli(_args: t.Optional[list[str]] = None) -> None:
"""Retrieve CJK information via CLI.
For help and example usage, see documentation:
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def zip_path(tmp_path: pathlib.Path) -> pathlib.Path:
@pytest.fixture
def zip_file(zip_path: pathlib.Path, fixture_path: pathlib.Path) -> zipfile.ZipFile:
"""Create and return ZipFile."""
_files = []
files = []
for f in UNIHAN_FILES:
_files += [fixture_path / f]
files += [fixture_path / f]
zf = zipfile.ZipFile(zip_path, "a")
for _f in _files:
for _f in files:
zf.write(_f, _f.name)
zf.close()
return zf
Expand Down
757 changes: 449 additions & 308 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 4d8140e

Please sign in to comment.