commit:     44c424dceea4786677cc302733787f2d0173d1f7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 31 20:50:24 2025 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 31 21:15:56 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=44c424dc

github ci: upgrade pre-commit flynt to 1.0.6 for python 3.14 ast.Str 
AttributeError fix

  File 
"/home/runner/.cache/pre-commit/repoapmmj_vi/py_env-python3/lib/python3.14/site-packages/flynt/transform/percent_transformer.py",
 line 217, in <module>
    ast.Str,
    ^^^^^^^
AttributeError: module 'ast' has no attribute 'Str'

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .pre-commit-config.yaml                                      |  2 +-
 lib/portage/cvstree.py                                       |  4 ++--
 .../package/ebuild/_parallel_manifest/ManifestTask.py        |  2 +-
 lib/portage/package/ebuild/config.py                         | 12 +++++-------
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4a69b805b8..2d01f3bd6f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -11,7 +11,7 @@ repos:
         additional_dependencies:
           - 'pytest'
   - repo: https://github.com/ikamensh/flynt/
-    rev: '1.0.1'
+    rev: '1.0.6'
     hooks:
       - id: flynt
   - repo: https://github.com/asottile/pyupgrade

diff --git a/lib/portage/cvstree.py b/lib/portage/cvstree.py
index 96d028d2be..0aa08cd94d 100644
--- a/lib/portage/cvstree.py
+++ b/lib/portage/cvstree.py
@@ -1,5 +1,5 @@
 # cvstree.py -- cvs tree utilities
-# Copyright 1998-2020 Gentoo Authors
+# Copyright 1998-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import re
@@ -61,7 +61,7 @@ def isadded(entries, path):
     mylines = myfile.readlines()
     myfile.close()
 
-    rep = re.compile(r"^\/%s\/" % re.escape(filename))
+    rep = re.compile(rf"^\/{re.escape(filename)}\/")
     for x in mylines:
         if rep.search(x):
             return 1

diff --git a/lib/portage/package/ebuild/_parallel_manifest/ManifestTask.py 
b/lib/portage/package/ebuild/_parallel_manifest/ManifestTask.py
index 5349c1fcc9..48decec4a7 100644
--- a/lib/portage/package/ebuild/_parallel_manifest/ManifestTask.py
+++ b/lib/portage/package/ebuild/_parallel_manifest/ManifestTask.py
@@ -34,7 +34,7 @@ class ManifestTask(CompositeTask):
     )
 
     _PGP_HEADER = b"BEGIN PGP SIGNED MESSAGE"
-    _manifest_line_re = re.compile(r"^(%s) " % "|".join(MANIFEST2_IDENTIFIERS))
+    _manifest_line_re = re.compile(rf"^({'|'.join(MANIFEST2_IDENTIFIERS)}) ")
     _gpg_key_id_re = re.compile(r"^[0-9A-F]*$")
     _gpg_key_id_lengths = (8, 16, 24, 32, 40)
 

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index e93655e58b..77485fac85 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2023 Gentoo Authors
+# Copyright 2010-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = [
@@ -1203,8 +1203,8 @@ class config:
             "PKG_CONFIG_.*",
         )
 
-        broot_only_variables_re = re.compile(r"^(%s)$" % 
"|".join(broot_only_variables))
-        eroot_only_variables_re = re.compile(r"^(%s)$" % 
"|".join(eroot_only_variables))
+        broot_only_variables_re = 
re.compile(rf"^({'|'.join(broot_only_variables)})$")
+        eroot_only_variables_re = 
re.compile(rf"^({'|'.join(eroot_only_variables)})$")
 
         broot_env_d_path = os.path.join(broot or "/", "etc", "profile.env")
         eroot_env_d_path = os.path.join(eroot or "/", "etc", "profile.env")
@@ -2644,7 +2644,7 @@ class config:
                 self._accept_chost_re = re.compile(".*")
             elif len(accept_chost) == 1:
                 try:
-                    self._accept_chost_re = re.compile(r"^%s$" % 
accept_chost[0])
+                    self._accept_chost_re = re.compile(rf"^{accept_chost[0]}$")
                 except re.error as e:
                     writemsg(
                         _("!!! Invalid ACCEPT_CHOSTS value: '%s': %s\n")
@@ -2654,9 +2654,7 @@ class config:
                     self._accept_chost_re = re.compile("^$")
             else:
                 try:
-                    self._accept_chost_re = re.compile(
-                        r"^(%s)$" % "|".join(accept_chost)
-                    )
+                    self._accept_chost_re = 
re.compile(rf"^({'|'.join(accept_chost)})$")
                 except re.error as e:
                     writemsg(
                         _("!!! Invalid ACCEPT_CHOSTS value: '%s': %s\n")

Reply via email to