From 1db04e4622c950b3fe490b0f27d9a506e2bc5b37 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 18 Sep 2021 23:15:53 -0700 Subject: [PATCH] delay importing of codeowners --- lib/python/qmk/maintainers.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/python/qmk/maintainers.py b/lib/python/qmk/maintainers.py index ccde8c07fb..c851c34fb9 100644 --- a/lib/python/qmk/maintainers.py +++ b/lib/python/qmk/maintainers.py @@ -1,16 +1,15 @@ from pathlib import Path -from codeowners import CodeOwners - from qmk.json_schema import json_load -codeowners_file = Path('CODEOWNERS') -codeowners = CodeOwners(codeowners_file.read_text()) - def maintainers(file): """Yields maintainers for a file. """ + from codeowners import CodeOwners + + codeowners_file = Path('CODEOWNERS') + codeowners = CodeOwners(codeowners_file.read_text()) maintainers = [owner[1] for owner in codeowners.of(str(file))] file_dir = file if file.is_dir() else file.parent