Skip to contentSkip to conversation

Two small cleanups to maintainers_include

PATCH Applied Mauro Carvalho Chehab 2 participants 4 messages May 16 – May 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Two small cleanups to maintainers_include

Hi Jon,

This series contain two minor cleanups to maintainers_include.py:

- make it backward compatible with Python < 3.10 (according with vermin, it should now be backward-compat up to 3.6)

- keep "THE REST" at the end.

Mauro Carvalho Chehab (2):
docs: maintainers_include: restore compatibility with Python 3.6
docs: maintainers_include: keep the last entry at the end

 Documentation/sphinx/maintainers_include.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH 1/2 docs: maintainers_include: restore compatibility with Python 3.6

glob root_dir parameter requires Python 3.10, which is more than our current Python minimal requirement.

---
 Documentation/sphinx/maintainers_include.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/sphinx/maintainers_include.py +1 -1
index be8e566e0363..b8b7282ebe38 100755
@@ -143,7 +143,7 @@ class MaintainersParser:
             if not m:
                 return None
 
-            doc_list = glob(m.group(1), root_dir=self.base_dir)
+            doc_list = glob(os.path.join(self.base_dir, m.group(1)))
         else:
             doc_list = [text]
 
Signature · 1 line
2.54.0
#2 lore raw

PATCH 2/2 docs: maintainers_include: keep the last entry at the end

In reply to Mauro Carvalho Chehab

The last maintainer's entry ("THE REST") is meant to be at the end. Ensure that.

While here, use a case-insensitive sort to avoid placing "iSCSI" near the end.

---
 Documentation/sphinx/maintainers_include.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/sphinx/maintainers_include.py +6 -1
index b8b7282ebe38..dc9f9e188ffa 100755
@@ -284,7 +284,12 @@ class MaintainersInclude(Include):
 
         self.state.document['maintainers_included'] = True
 
-        for name, fields in sorted(maint_parser.maint_entries.items()):
+        # Keep the last entry ("THE REST") in the end
+        entries = list(maint_parser.maint_entries.keys())
+        entries = sorted(entries[:-1], key=str.casefold) + [entries[-1]]
+
+        for name in entries:
+            fields = maint_parser.maint_entries[name]
             output += f"  * - {name}\n"
             tag = "-"
             for field, lines in fields.items():
Signature · 1 line
2.54.0
maintainer Applied
#3 lore raw
In reply to Mauro Carvalho Chehab
Quoted 8 lines · Mauro Carvalho Chehab

Hi Jon,

This series contain two minor cleanups to maintainers_include.py:

- make it backward compatible with Python < 3.10 (according with vermin, it should now be backward-compat up to 3.6)

Quoted 8 lines

- keep "THE REST" at the end.

Mauro Carvalho Chehab (2):
docs: maintainers_include: restore compatibility with Python 3.6
docs: maintainers_include: keep the last entry at the end

 Documentation/sphinx/maintainers_include.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Applied, thanks.

jon