From 49d463fdb938b5c504c8b77ff4fabe07ff21736e Mon Sep 17 00:00:00 2001 From: Nyako Shigure Date: Sun, 24 May 2026 01:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20refactor:=20remove=20PEP=20563?= =?UTF-8?q?=20future=20annotations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove postponed-annotation future imports now that the package requires Python 3.14. Also remove the Ruff/isort configuration that selected flake8-future-annotations and auto-added the import back. Co-authored-by: Codex --- pyproject.toml | 4 ---- src/gh_llm/__init__.py | 2 -- src/gh_llm/__main__.py | 2 -- src/gh_llm/cli.py | 2 -- src/gh_llm/commands/__init__.py | 1 - src/gh_llm/commands/doctor.py | 2 -- src/gh_llm/commands/issue.py | 2 -- src/gh_llm/commands/options.py | 2 -- src/gh_llm/commands/pr.py | 2 -- src/gh_llm/commands/repo.py | 2 -- src/gh_llm/diagnostics.py | 2 -- src/gh_llm/environment.py | 2 -- src/gh_llm/github_api.py | 2 -- src/gh_llm/invocation.py | 2 -- src/gh_llm/models.py | 2 -- src/gh_llm/pager.py | 2 -- src/gh_llm/pr_body.py | 2 -- src/gh_llm/render.py | 2 -- tests/test_cli.py | 2 -- tests/test_command_options.py | 2 -- tests/test_extension_entrypoint.py | 2 -- tests/test_pr_body.py | 2 -- 22 files changed, 45 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9720f7b..5ad7d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,18 +68,14 @@ select = [ "RSE", # Refurb "FURB", - # Flake8-future-annotations - "FA", # Yesqa "RUF100", ] ignore = [ "E501", # line too long, duplicate with ruff fmt ] -future-annotations = true [tool.ruff.lint.isort] -required-imports = ["from __future__ import annotations"] known-first-party = ["gh_llm"] combine-as-imports = true diff --git a/src/gh_llm/__init__.py b/src/gh_llm/__init__.py index 8d4ce60..73bdef4 100644 --- a/src/gh_llm/__init__.py +++ b/src/gh_llm/__init__.py @@ -1,6 +1,4 @@ # Meta information for the project. -from __future__ import annotations - __version__ = "0.1.16" __author__ = "Nyakku Shigure" __year__ = "2026" diff --git a/src/gh_llm/__main__.py b/src/gh_llm/__main__.py index fdeba82..fab7e17 100644 --- a/src/gh_llm/__main__.py +++ b/src/gh_llm/__main__.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import sys from gh_llm.cli import run diff --git a/src/gh_llm/cli.py b/src/gh_llm/cli.py index d99cdc0..2d89cef 100644 --- a/src/gh_llm/cli.py +++ b/src/gh_llm/cli.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import argparse import shlex import sys diff --git a/src/gh_llm/commands/__init__.py b/src/gh_llm/commands/__init__.py index 9d48db4..e69de29 100644 --- a/src/gh_llm/commands/__init__.py +++ b/src/gh_llm/commands/__init__.py @@ -1 +0,0 @@ -from __future__ import annotations diff --git a/src/gh_llm/commands/doctor.py b/src/gh_llm/commands/doctor.py index 312a5c2..c285477 100644 --- a/src/gh_llm/commands/doctor.py +++ b/src/gh_llm/commands/doctor.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import os import shlex diff --git a/src/gh_llm/commands/issue.py b/src/gh_llm/commands/issue.py index 1da91b8..5339af3 100644 --- a/src/gh_llm/commands/issue.py +++ b/src/gh_llm/commands/issue.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass from typing import TYPE_CHECKING, Any diff --git a/src/gh_llm/commands/options.py b/src/gh_llm/commands/options.py index bb7de60..869fa5a 100644 --- a/src/gh_llm/commands/options.py +++ b/src/gh_llm/commands/options.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import sys from datetime import UTC, datetime from difflib import get_close_matches diff --git a/src/gh_llm/commands/pr.py b/src/gh_llm/commands/pr.py index 0a0f399..4584717 100644 --- a/src/gh_llm/commands/pr.py +++ b/src/gh_llm/commands/pr.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import os import re diff --git a/src/gh_llm/commands/repo.py b/src/gh_llm/commands/repo.py index 59097d9..ff64120 100644 --- a/src/gh_llm/commands/repo.py +++ b/src/gh_llm/commands/repo.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import TYPE_CHECKING, Any from gh_llm.github_api import GitHubClient diff --git a/src/gh_llm/diagnostics.py b/src/gh_llm/diagnostics.py index f6049bc..9c369e9 100644 --- a/src/gh_llm/diagnostics.py +++ b/src/gh_llm/diagnostics.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import shlex from dataclasses import dataclass from typing import TYPE_CHECKING diff --git a/src/gh_llm/environment.py b/src/gh_llm/environment.py index 9ac5a15..71df95c 100644 --- a/src/gh_llm/environment.py +++ b/src/gh_llm/environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import os import shlex from typing import TYPE_CHECKING diff --git a/src/gh_llm/github_api.py b/src/gh_llm/github_api.py index b397f31..a5b8b84 100644 --- a/src/gh_llm/github_api.py +++ b/src/gh_llm/github_api.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import base64 import binascii import json diff --git a/src/gh_llm/invocation.py b/src/gh_llm/invocation.py index 110ac7f..dfd2d2d 100644 --- a/src/gh_llm/invocation.py +++ b/src/gh_llm/invocation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import os from pathlib import Path diff --git a/src/gh_llm/models.py b/src/gh_llm/models.py index caf4228..e68a956 100644 --- a/src/gh_llm/models.py +++ b/src/gh_llm/models.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass, field from typing import TYPE_CHECKING, cast diff --git a/src/gh_llm/pager.py b/src/gh_llm/pager.py index d0b8480..a2ba574 100644 --- a/src/gh_llm/pager.py +++ b/src/gh_llm/pager.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import math from typing import TYPE_CHECKING diff --git a/src/gh_llm/pr_body.py b/src/gh_llm/pr_body.py index b0ed65e..c81696f 100644 --- a/src/gh_llm/pr_body.py +++ b/src/gh_llm/pr_body.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re import unicodedata from dataclasses import dataclass diff --git a/src/gh_llm/render.py b/src/gh_llm/render.py index c6ebfd1..4efd6b0 100644 --- a/src/gh_llm/render.py +++ b/src/gh_llm/render.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import re import shlex diff --git a/tests/test_cli.py b/tests/test_cli.py index 92e405d..8cff261 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import argparse import base64 import json diff --git a/tests/test_command_options.py b/tests/test_command_options.py index ee45a9e..d4d56a0 100644 --- a/tests/test_command_options.py +++ b/tests/test_command_options.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import argparse import pytest diff --git a/tests/test_extension_entrypoint.py b/tests/test_extension_entrypoint.py index 238a06c..b39c0ca 100644 --- a/tests/test_extension_entrypoint.py +++ b/tests/test_extension_entrypoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import os import stat import subprocess diff --git a/tests/test_pr_body.py b/tests/test_pr_body.py index b36b77e..8d4a49e 100644 --- a/tests/test_pr_body.py +++ b/tests/test_pr_body.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from gh_llm.pr_body import ( build_pull_request_body_scaffold, extract_markdown_section_titles,