]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Bump minimum version of python to 3.9
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 17 Feb 2026 09:20:05 +0000 (10:20 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Feb 2026 09:47:15 +0000 (18:47 +0900)
This was announced in fd8c62075197e4f4702bb6e4537116a64cb539b7 and every
still-supported distributo release provides at least 3.9, as tracked by #38608.

.github/workflows/build-test.yml
README
meson.build
ruff.toml
test/test-udev.py

index 06bff4bc74d50e41618444a0d4d059b975807179..8c70f656eb94efa82ced1d1f3e37893a611bb35a 100644 (file)
@@ -47,7 +47,7 @@ jobs:
           # older glibc
           - env: { COMPILER: "gcc",   COMPILER_VERSION: "12", LINKER: "bfd", CUSTOM_PYTHON: "1"  }
             runner: [ ubuntu-22.04 ]
-            python-version: '3.7'
+            python-version: '3.9'
     env: ${{ matrix.env }}
     steps:
       - name: Repository checkout
diff --git a/README b/README
index 9158cb128359718713ada8b5446d93d1256b1805..d85295b10e234d58f185b1906cf95a4017b6789d 100644 (file)
--- a/README
+++ b/README
@@ -247,7 +247,7 @@ REQUIREMENTS:
         gperf
         docbook-xsl (optional, required for documentation)
         xsltproc    (optional, required for documentation)
-        python >= 3.7 (required by meson too, >= 3.9 is required for ukify)
+        python >= 3.9
         python-jinja2
         python-pefile (optional, required for ukify)
         python-lxml (optional, required to build the indices)
index 0361bc5904aaadeb82d086027145425f994c5360..bf419b7f60f5db14bc2990c874129dbd0aa66d32 100644 (file)
@@ -1695,7 +1695,9 @@ conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', want_slow_tests)
 
 pymod = import('python')
 python = pymod.find_installation('python3', required : true, modules : ['jinja2'])
-python_39 = python.language_version().version_compare('>=3.9')
+if not python.language_version().version_compare('>=3.9')
+        error('Python >= 3.9 is required')
+endif
 
 #####################################################################
 
@@ -1896,9 +1898,7 @@ if have and efi_arch == 'x64' and cc.links('''
         efi_cpu_family_alt = 'x86'
 endif
 
-pefile = pymod.find_installation('python3', required: false, modules : ['pefile'])
-
-want_ukify = get_option('ukify').require(python_39 and pefile.found(), error_message : 'Python >= 3.9 and pefile required').allowed()
+want_ukify = pymod.find_installation('python3', required: get_option('ukify'), modules : ['pefile']).found()
 conf.set10('ENABLE_UKIFY', want_ukify)
 
 #####################################################################
index 8ace55fb967a5daf57a3455df64f5bd94355235d..6c0ec6ceb84bb067e895ea07a4afb8bb58a65bec 100644 (file)
--- a/ruff.toml
+++ b/ruff.toml
@@ -1,11 +1,6 @@
-target-version = "py37"
+target-version = "py39"
 line-length = 109
 lint.select = ["E", "F", "I", "UP"]
 
 [format]
 quote-style = "single"
-
-[per-file-target-version]
-"src/ukify/*.py" = "py39"
-"test/**/integration-test-wrapper.py" = "py39"
-"test/test-udev.py" = "py39"
index 49695ef7394da0fc238fbd8b079c1c1a71853276..20b55de7d679d03256656f369d5744ad0011a230 100755 (executable)
@@ -17,6 +17,7 @@
 # removes the device node. After creation and removal the result is checked
 # against the expected value and the result is printed.
 
+import dataclasses
 import functools
 import os
 import pwd, grp
@@ -30,7 +31,6 @@ from pathlib import Path
 from typing import Callable, Optional
 
 try:
-    import dataclasses  # requires Python >= 3.7
     import pytest
 except ImportError as e:
     print(str(e), file=sys.stderr)