diff --git a/custom_theme/img/favicon.ico b/docs/img/favicon.ico similarity index 100% rename from custom_theme/img/favicon.ico rename to docs/img/favicon.ico diff --git a/mkdocs.yml b/mkdocs.yml index 40af4a02..5cf7d26b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,8 +1,9 @@ site_name: Snowfakery documentation site_url: "" use_directory_urls: False -theme: readthedocs -custom_dir: custom_theme +theme: + name: readthedocs + custom_dir: custom_theme repo_url: https://github.com/SFDO-Tooling/Snowfakery/ nav: - index.md diff --git a/requirements/dev.in b/requirements/dev.in index d72d8037..d37d1f0a 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -3,7 +3,7 @@ black coverage coveralls diff-cover -mkdocs<1.3.0 # need to change Snowfakery monkey-patching before upgrade +mkdocs mkdocs-exclude-search pre-commit pytest diff --git a/requirements/dev.txt b/requirements/dev.txt index 4ea494bb..0f373223 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -106,7 +106,7 @@ markupsafe==2.1.5 # jinja2 mergedeep==1.3.4 # via mkdocs -mkdocs==1.2.4 +mkdocs==1.5.3 # via # -r requirements/dev.in # mkdocs-exclude-search diff --git a/snowfakery/tools/mkdocs.py b/snowfakery/tools/mkdocs.py index a82ac31f..7789de3c 100644 --- a/snowfakery/tools/mkdocs.py +++ b/snowfakery/tools/mkdocs.py @@ -4,13 +4,11 @@ from unittest.mock import patch from mkdocs.plugins import BasePlugin -import mkdocs +from mkdocs.config import config_options class Plugin(BasePlugin): - config_scheme = ( - ("build_locales", mkdocs.config.config_options.Type(bool, default=False)), # type: ignore - ) + config_scheme = (("build_locales", config_options.Type(bool, default=False)),) def on_config(self, config): """Look for and load main_mkdocs_plugin in tools/faker_docs_utils/mkdocs_plugins.py diff --git a/tools/faker_docs_utils/faker_markdown.py b/tools/faker_docs_utils/faker_markdown.py index 957dda3d..ee56f0d5 100644 --- a/tools/faker_docs_utils/faker_markdown.py +++ b/tools/faker_docs_utils/faker_markdown.py @@ -176,7 +176,7 @@ def generate_markdown_for_all_locales(path: Path, locales=None): generate_markdown_for_fakers(f, locale) -def generate_locales_index(path: Path, locales_list: T.List[str]): +def generate_locales_index(path: T.Union[Path,str], locales_list: T.List[str]): "Generate markdown index including listed locales. None means all locales" locales_list = locales_list or AVAILABLE_LOCALES with Path(path).open("w") as outfile: diff --git a/tools/faker_docs_utils/mkdocs_plugins/main_mkdocs_plugin.py b/tools/faker_docs_utils/mkdocs_plugins/main_mkdocs_plugin.py index 0bcdf416..18770b5a 100644 --- a/tools/faker_docs_utils/mkdocs_plugins/main_mkdocs_plugin.py +++ b/tools/faker_docs_utils/mkdocs_plugins/main_mkdocs_plugin.py @@ -35,10 +35,6 @@ def new_warning(self, *args, **kwargs): logger_patch = patch("logging.Logger.warning", new=new_warning) # speed up a critical function - # - # Disabled due to Faker refactoring. After release can look into - # whether it is still needed. - # lru_patch = patch( "faker.factory.Factory._find_provider_class", lru_cache(maxsize=10_000)(Factory._find_provider_class),