Skip to content

Commit 8fe4e71

Browse files
committed
boot-utils: Bump minimum supported version to Python 3.9
We are going to be adding type annotations to boot-utils. There were several changes to type annotations in Python 3.9 that are not compatible with Python 3.8 and easier, such as list[str] instead of List[str], so just drop support for Python 3.9. With a tool like uv, it is easy to get a newer version of Python if necessary to run boot-utils. With this bump, ruff formats a couple of files differently. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 5d7a2be commit 8fe4e71

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
version: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
9+
version: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9']
1010
uses: ClangBuiltLinux/actions-workflows/.github/workflows/python_lint.yml@main
1111
with:
1212
python_version: ${{ matrix.version }}

boot-qemu.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ def _run_gdb(self):
226226
# pylint: disable-next=unexpected-keyword-arg
227227
with subprocess.Popen(qemu_cmd, **popen_kwargs) as qemu_proc:
228228
utils.green(f"Starting {self.gdb_bin}...")
229-
with subprocess.Popen(gdb_cmd) as gdb_proc, contextlib.suppress(
230-
KeyboardInterrupt
229+
with (
230+
subprocess.Popen(gdb_cmd) as gdb_proc,
231+
contextlib.suppress(KeyboardInterrupt),
231232
):
232233
gdb_proc.wait()
233234

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target-version = 'py38'
1+
target-version = 'py39'
22

33
[format]
44
quote-style = 'preserve'

utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,12 @@ def prepare_initrd(architecture, rootfs_format='cpio', gh_json_file=None, module
238238
)
239239

240240
(new_dst := dst.parent.joinpath('rootfs-modules.cpio')).unlink(missing_ok=True)
241-
with subprocess.Popen(
242-
['cat', dst, modules], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
243-
) as proc, new_dst.open('xb') as dst_file:
241+
with (
242+
subprocess.Popen(
243+
['cat', dst, modules], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
244+
) as proc,
245+
new_dst.open('xb') as dst_file,
246+
):
244247
dst_file.write(proc.stdout.read())
245248
dst = new_dst
246249

0 commit comments

Comments
 (0)