🔧 Upgrade Material for MkDocs and remove insiders (#1650)

This commit is contained in:
Sebastián Ramírez
2025-11-20 13:12:37 +01:00
committed by GitHub
parent e4763e3e18
commit 4006f7b864
8 changed files with 11 additions and 37 deletions

View File

@@ -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)