mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-12-12 07:28:55 +08:00
🔧 Upgrade Material for MkDocs and remove insiders (#1650)
This commit is contained in:
committed by
GitHub
parent
e4763e3e18
commit
4006f7b864
@@ -2,9 +2,7 @@ import logging
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from functools import lru_cache
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
from importlib import metadata
|
||||
from pathlib import Path
|
||||
|
||||
import mkdocs.utils
|
||||
@@ -19,17 +17,9 @@ en_docs_path = Path("")
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@lru_cache
|
||||
def is_mkdocs_insiders() -> bool:
|
||||
version = metadata.version("mkdocs-material")
|
||||
return "insiders" in version
|
||||
|
||||
|
||||
@app.callback()
|
||||
def callback() -> None:
|
||||
if is_mkdocs_insiders():
|
||||
os.environ["INSIDERS_FILE"] = "./mkdocs.insiders.yml"
|
||||
# For MacOS with insiders and Cairo
|
||||
# For MacOS with Cairo
|
||||
os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib"
|
||||
|
||||
|
||||
@@ -126,10 +116,6 @@ def build() -> None:
|
||||
"""
|
||||
Build the docs.
|
||||
"""
|
||||
insiders_env_file = os.environ.get("INSIDERS_FILE")
|
||||
print(f"Insiders file {insiders_env_file}")
|
||||
if is_mkdocs_insiders():
|
||||
print("Using insiders")
|
||||
print("Building docs")
|
||||
subprocess.run(["mkdocs", "build"], check=True)
|
||||
typer.secho("Successfully built docs", color=typer.colors.GREEN)
|
||||
|
||||
Reference in New Issue
Block a user