@@ -105,7 +105,7 @@ def serve() -> None:
105105@click .option (
106106 "--versions" ,
107107 required = True ,
108- help = "Comma-separated Python versions (e.g., 3.12,3.13)" ,
108+ help = "Comma-separated Python versions (e.g., 3.10,3.11,3. 12,3.13,3.14 )" ,
109109)
110110@click .option (
111111 "--skip-content" ,
@@ -120,6 +120,9 @@ def build_index(versions: str, skip_content: bool) -> None:
120120 import venv
121121 from pathlib import Path
122122
123+ from mcp_server_python_docs .ingestion .cpython_versions import (
124+ CPYTHON_DOCS_BUILD_CONFIG ,
125+ )
123126 from mcp_server_python_docs .ingestion .inventory import ingest_inventory
124127 from mcp_server_python_docs .ingestion .publish import (
125128 _version_sort_key ,
@@ -128,6 +131,7 @@ def build_index(versions: str, skip_content: bool) -> None:
128131 publish_index ,
129132 )
130133 from mcp_server_python_docs .ingestion .sphinx_json import (
134+ build_sphinx_bootstrap_requirements ,
131135 build_sphinx_json_command ,
132136 ingest_sphinx_json_dir ,
133137 make_sphinx_json_env ,
@@ -142,15 +146,11 @@ def build_index(versions: str, skip_content: bool) -> None:
142146 get_readwrite_connection ,
143147 )
144148
145- # Version tag mapping: CPython git tag and Sphinx constraints (INGR-C-02)
146- VERSION_CONFIG : dict [str , dict [str , str ]] = {
147- "3.12" : {"tag" : "v3.12.13" , "sphinx_pin" : "sphinx~=8.2.0" },
148- "3.13" : {"tag" : "v3.13.12" , "sphinx_pin" : "sphinx<9.0.0" },
149- }
150-
151149 version_list = parse_expected_versions (versions )
152150 if not version_list :
153- logger .error ("No valid versions specified. Example: --versions 3.13" )
151+ logger .error (
152+ "No valid versions specified. Example: --versions 3.10,3.11,3.12,3.13,3.14"
153+ )
154154 raise SystemExit (1 )
155155
156156 # Validate version format before sorting (CR-03, WR-04)
@@ -188,7 +188,7 @@ def build_index(versions: str, skip_content: bool) -> None:
188188 continue
189189
190190 # === Content ingestion (INGR-C-01 through INGR-C-03) ===
191- config = VERSION_CONFIG .get (version )
191+ config = CPYTHON_DOCS_BUILD_CONFIG .get (version )
192192 if not config :
193193 logger .warning (
194194 "No CPython build config for %s, skipping content ingestion" ,
@@ -226,9 +226,17 @@ def build_index(versions: str, skip_content: bool) -> None:
226226 )
227227 pip_path = os .path .join (scripts_dir , "pip" )
228228
229- # Install Sphinx with the version pin for this CPython branch
229+ # Install Sphinx with the version pin for this CPython branch.
230+ # Older Sphinx releases still import pkg_resources, which
231+ # modern venvs do not always seed by default.
230232 subprocess .run (
231- [pip_path , "install" , config ["sphinx_pin" ]],
233+ [
234+ pip_path ,
235+ "install" ,
236+ * build_sphinx_bootstrap_requirements (
237+ config ["sphinx_pin" ]
238+ ),
239+ ],
232240 check = True ,
233241 capture_output = True ,
234242 text = True ,
@@ -381,7 +389,10 @@ def validate_corpus(db_path: str | None) -> None:
381389
382390 if not target .exists ():
383391 logger .error ("Index not found at %s" , target )
384- logger .error ("Run: mcp-server-python-docs build-index --versions 3.13" )
392+ logger .error (
393+ "Run: mcp-server-python-docs build-index --versions "
394+ "3.10,3.11,3.12,3.13,3.14"
395+ )
385396 raise SystemExit (1 )
386397
387398 logger .info ("Validating corpus at %s" , target )
@@ -506,7 +517,8 @@ def doctor() -> None:
506517 index_detail = str (index_path )
507518 if not index_exists :
508519 index_detail += (
509- " (not found -- run: mcp-server-python-docs build-index --versions 3.13)"
520+ " (not found -- run: mcp-server-python-docs build-index --versions "
521+ "3.10,3.11,3.12,3.13,3.14)"
510522 )
511523 else :
512524 size_mb = index_path .stat ().st_size / (1024 * 1024 )
0 commit comments