diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/snakeoil/dist/sphinxext.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/snakeoil/dist/sphinxext.py b/src/snakeoil/dist/sphinxext.py index 7d04c49d..36d63e23 100644 --- a/src/snakeoil/dist/sphinxext.py +++ b/src/snakeoil/dist/sphinxext.py @@ -30,9 +30,19 @@ def prepare_scripts_man(repo_dir: Path, man_pages: list[tuple]): with open(repo_dir / 'pyproject.toml', 'rb') as file: pyproj = tomllib.load(file) - authors_list = [ - f'{author["name"]} <{author["email"]}>' for author in pyproj['project']['authors'] - ] + authors_list: list[str] = [] + for author in pyproj['project']['authors']: + name, email = author.get('name'), author.get('email') + if name: + if email: + authors_list.append(f'{name} <{email}>') + else: + authors_list.append(name) + elif email: + authors_list.append(email) + else: + # no name or contact info, so ignore it. + continue for i, man_page in enumerate(man_pages): if man_page[3] is None: |