Skip to content

Commit e643b90

Browse files
authored
Merge pull request #260 from hartwork/python-3-10-to-3-14
Support Python 3.10 to 3.14
2 parents d741a6f + ecdd6f1 commit e643b90

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Run the test suite
1313
strategy:
1414
matrix:
15-
python-version: [3.9, 3.13] # no particular need for in-between versions
15+
python-version: ["3.10", 3.14] # no particular need for in-between versions
1616
runs-on: [macos-latest, ubuntu-latest]
1717
runs-on: ${{ matrix.runs-on }}
1818
steps:

git_delete_merged_branches/_engine.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from functools import partial, reduce
77
from operator import and_
88
from subprocess import CalledProcessError
9-
from typing import Optional
109

1110
from ._git import CheckoutFailed, MergeBaseFailed, PullFailed
1211
from ._metadata import APP
@@ -197,7 +196,7 @@ def find_enabled_remotes(cls, git_config):
197196
return cls._filter_git_config(git_config, cls._PATTERN_REMOTE_ENABLED)
198197

199198
def _find_branches_merged_using_git_branch_merged(
200-
self, required_target_branches, remote_name: Optional[str]
199+
self, required_target_branches, remote_name: str | None
201200
) -> set[str]:
202201
if remote_name is None:
203202
find_branches_that_were_merged_into = self._git.find_merged_local_branches_for
@@ -301,7 +300,7 @@ def _find_branches_merged_using_git_cherry(
301300
return branches_merged_to_all_required_targets
302301

303302
def _find_branches_merged_to_all_targets_for_single_remote(
304-
self, required_target_branches, excluded_branches: set[str], remote_name: Optional[str]
303+
self, required_target_branches, excluded_branches: set[str], remote_name: str | None
305304
) -> tuple[set[str], set[str]]:
306305
if remote_name is not None:
307306
excluded_branches = {

git_delete_merged_branches/_git.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import subprocess
66
from collections import OrderedDict
7-
from typing import Optional
87

98
from ._metadata import APP
109

@@ -146,7 +145,7 @@ def find_remote_branches_at(self, remote_name) -> list[str]:
146145
extra_argv = ["--remote", "--list", f"{remote_name}/*"]
147146
return self._find_branches(extra_argv)
148147

149-
def find_current_branch(self) -> Optional[str]:
148+
def find_current_branch(self) -> str | None:
150149
# Note: Avoiding "git branch --show-current" of Git >=2.22.0
151150
# to keep Git 2.17.1 of Ubuntu 18.04 in the boat, for now.
152151
argv = [self._GIT, "rev-parse", "--symbolic-full-name", "HEAD"]
@@ -160,15 +159,15 @@ def find_current_branch(self) -> Optional[str]:
160159
return None # detached head
161160
return reference[len(expected_prefix) :]
162161

163-
def find_working_tree_branches(self) -> list[Optional[str]]:
162+
def find_working_tree_branches(self) -> list[str | None]:
164163
argv = [self._GIT, "worktree", "list", "--porcelain"] # requires Git >=2.7.0
165164
output_bytes = self._subprocess_check_output(argv, is_write=False)
166165
lines = self._output_bytes_to_lines(output_bytes)
167166

168167
detached_line_prefix = "detached"
169168
branch_line_prefix = "branch "
170169
branch_prefix = "refs/heads/"
171-
branch_names: list[Optional[str]] = []
170+
branch_names: list[str | None] = []
172171

173172
for line in lines:
174173
if line.startswith(detached_line_prefix):
@@ -266,7 +265,7 @@ def pull_ff_only(self) -> None:
266265
raise PullFailed
267266
raise
268267

269-
def _has_changes(self, extra_argv: Optional[list[str]] = None) -> bool:
268+
def _has_changes(self, extra_argv: list[str] | None = None) -> bool:
270269
argv = [self._GIT, "diff", "--exit-code", "--quiet"]
271270
if extra_argv:
272271
argv += extra_argv

git_delete_merged_branches/_multiselect.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from abc import ABC
55
from dataclasses import dataclass
6-
from typing import Any, Optional
6+
from typing import Any
77

88
from prompt_toolkit.application import Application
99
from prompt_toolkit.buffer import Buffer
@@ -137,7 +137,7 @@ def write_to_screen(
137137
write_position: WritePosition,
138138
parent_style: str,
139139
erase_bg: bool,
140-
z_index: Optional[int],
140+
z_index: int | None,
141141
) -> None:
142142
self.current_height = write_position.height
143143
super().write_to_screen(
@@ -191,9 +191,9 @@ def __init__(
191191
self._header_lines: [_MultiSelectPrompt.HeaderLine] = []
192192
self._footer_lines: [_MultiSelectPrompt.PlainLine] = []
193193

194-
self._item_selection_pane: Optional[_HeightTrackingScrollablePane] = None
195-
self._buffer: Optional[Buffer] = None
196-
self._document: Optional[Document] = None
194+
self._item_selection_pane: _HeightTrackingScrollablePane | None = None
195+
self._buffer: Buffer | None = None
196+
self._document: Document | None = None
197197
self._accepted_selection: list[Any] = None
198198

199199
def _move_cursor_one_page_vertically(self, upwards: bool):

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
indent-width = 4
22
line-length = 100
3-
target-version = "py39"
3+
target-version = "py310"
44

55
[lint]
66
select = [

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author="Sebastian Pipping",
2525
author_email="sebastian@pipping.org",
2626
url=f"https://github.com/hartwork/{APP}",
27-
python_requires=">=3.9",
27+
python_requires=">=3.10",
2828
setup_requires=[
2929
"setuptools>=38.6.0", # for long_description_content_type
3030
],
@@ -48,11 +48,11 @@
4848
"Programming Language :: Python",
4949
"Programming Language :: Python :: 3",
5050
"Programming Language :: Python :: 3 :: Only",
51-
"Programming Language :: Python :: 3.9",
5251
"Programming Language :: Python :: 3.10",
5352
"Programming Language :: Python :: 3.11",
5453
"Programming Language :: Python :: 3.12",
5554
"Programming Language :: Python :: 3.13",
55+
"Programming Language :: Python :: 3.14",
5656
"Topic :: Software Development :: Version Control",
5757
"Topic :: Software Development :: Version Control :: Git",
5858
],

0 commit comments

Comments
 (0)