Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let mkdocs float #1031

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
site_name: Snowfakery documentation
site_url: ""
use_directory_urls: False
theme: readthedocs
custom_dir: custom_theme
theme:
name: readthedocs
repo_url: https://github.com/SFDO-Tooling/Snowfakery/
nav:
- index.md
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions snowfakery/tools/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/faker_docs_utils/faker_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions tools/faker_docs_utils/mkdocs_plugins/main_mkdocs_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading