diff --git a/src/pulp_docs/cli.py b/src/pulp_docs/cli.py index 39245c0..62e9aa2 100644 --- a/src/pulp_docs/cli.py +++ b/src/pulp_docs/cli.py @@ -6,7 +6,6 @@ import os import subprocess import sys -import tempfile from pathlib import Path import click diff --git a/src/pulp_docs/mkdocs_macros.py b/src/pulp_docs/mkdocs_macros.py index 635fa8a..3d698a9 100644 --- a/src/pulp_docs/mkdocs_macros.py +++ b/src/pulp_docs/mkdocs_macros.py @@ -180,7 +180,8 @@ def _place_doc_files(src_dir: Path, docs_dir: Path, repo: Repo): # Create placeholder, case it was not possible to fetch one empty_changelog = changes_dir / "changelog.md" empty_changelog.write_text( - "# Changelog\n\nThe repository does not provide a changelog or there was a problem fetching it." + "# Changelog\n\nThe repository does not provide a changelog or" + "there was a problem fetching it." ) @@ -222,7 +223,8 @@ def print_user_repo(repos: Repos, config: Config): # TODO: improve this refspec comparision heuristics if repo.branch not in repo.branch_in_use: warn_msgs.append( - f"[pulp-docs] Original {repo.name!r} ref is {repo.branch!r}, but local one is '{repo.branch_in_use}'." + f"[pulp-docs] Original {repo.name!r} ref is {repo.branch!r}," + f"but local one is '{repo.branch_in_use}'." ) if len(local_checkouts) == 0: diff --git a/src/pulp_docs/repository.py b/src/pulp_docs/repository.py index afefe45..fb55b2c 100644 --- a/src/pulp_docs/repository.py +++ b/src/pulp_docs/repository.py @@ -6,13 +6,11 @@ from __future__ import annotations import logging -import os import shutil import subprocess import tarfile import tempfile import typing as t -from collections import ChainMap, defaultdict from dataclasses import dataclass, field from io import BytesIO from pathlib import Path @@ -68,10 +66,6 @@ class Repo: def __post_init__(self): self.branch_in_use = self.branch_in_use or self.branch - @property - def rest_api_link(self): - return RESTAPI_TEMPLATE.format(self.name) - def download(self, dest_dir: Path, clear_cache: bool = False) -> str: """ Download repository source from url into the {dest_dir} Path. @@ -162,8 +156,6 @@ def download_from_gh_latest(dest_dir: Path, owner: str, name: str): """ Download repository source-code from latest GitHub Release (w/ GitHub API). - See: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release - Returns the download url. """ latest_release_link_url = ( diff --git a/src/pulp_docs/utils/aggregation.py b/src/pulp_docs/utils/aggregation.py index c9f8f4c..9cd1af6 100644 --- a/src/pulp_docs/utils/aggregation.py +++ b/src/pulp_docs/utils/aggregation.py @@ -1,5 +1,4 @@ import os -import re import typing as t from pathlib import Path @@ -67,9 +66,15 @@ def repo_grouping( Get all markdown files that matches @template_str basepath and group by repos. Arguments: - template_str: The template with fields to expand. Accepts combination of '{repo}' and '{content}' - repo_types: The set of repos to use. Accepts list with combination of "core", "content" and "other" - content_types: The set of content-types to use. Accepts combination of "guides", "learn" and "tutorial" + template_str: + The template with fields to expand. + Accepts combination of '{repo}' and '{content}' + repo_types: + The set of repos to use. + Accepts list with combination of "core", "content" and "other" + content_types: + The set of content-types to use. + Accepts combination of "guides", "learn" and "tutorial" Example: ```python