Skip to content

Commit 2728726

Browse files
romanlutzCopilot
andcommitted
FIX: Backport minimal RTD config fixes so v0.12.1 builds on RTD
The v0.12.1 release tag predates every RTD fix that landed on main (#1673, #1676, #1682, #1740, #1745, #1793, #1825), so RTD could not build v0.12.1 from the tag. This commit backports only the surgical changes needed to make the v0.12.1 content build under the current RTD environment. After this lands, RTD's v0.12.1 version is reconfigured to track this branch rather than the immutable tag. Same pattern as the v0.13.0 backport on releases/v0.13.0. 1. .readthedocs.yaml -- the tag's config had three issues that combined to make RTD fail before producing any output: * build.jobs.build.commands is not a valid key (RTD only accepts html/pdf/epub/htmlzip under build.jobs.build). This was a hard config-validation error that aborted the build immediately. * When build.jobs is defined, RTD ignores the legacy python.install block, so dependencies were never installed and the pre_build step would have failed on 'ModuleNotFoundError: No module named griffe'. Fixed by adding an explicit build.jobs.install step running pip install .[dev] -- v0.12.1 uses [project.optional-dependencies], not PEP 735 [dependency-groups] -- and dropping the dead python.install block. * jupyter-book build --all builds frontmatter exports only (PDF per doc/myst.yml), not the static HTML site. --html is required to produce _build/html/index.html, which is what RTD serves. Also fixed the cp source to point at _build/html/ instead of _build/site/. 2. doc/myst.yml -- removes the api/pyrit_setup_initializers.md TOC entry. gen_api_md.py does not emit this page because pyrit.setup has its own API members and the script only expands pure-aggregate modules. Unlike at v0.13.0, api/pyrit_ui.md IS generated for v0.12.1 (the pyrit/ui/ subpackage still existed in this tree) so that TOC entry is kept. 3. doc/getting_started/troubleshooting/{deploy_hf_model_aml,download_and_register_hf_model_aml,score_aml_endpoint}.ipynb -- correct the AML image relative paths from ./../../assets/ to ./../../../assets/. The paired .py source-of-truth files already use the correct 3-up path, and these notebooks have been out-of-sync with their source since before v0.12.0. Same fix that landed on main in PR #1740. Verified locally: pip install .[dev] + pre_build + build produce doc/_build/html/index.html (196 KB) and 1871 site files, with all 'Cannot find image' warnings gone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3873c77 commit 2728726

5 files changed

Lines changed: 21 additions & 20 deletions

File tree

.readthedocs.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ build:
1111
python: "3.13"
1212
nodejs: "20"
1313
jobs:
14+
install:
15+
# When build.jobs is defined, RTD ignores the legacy python.install
16+
# block (below), so dependencies must be installed explicitly here.
17+
# v0.12.1 uses [project.optional-dependencies] (dev extra), not the
18+
# PEP 735 [dependency-groups] introduced on main after the tag.
19+
- pip install ".[dev]"
1420
pre_build:
1521
- python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json
1622
- python build_scripts/gen_api_md.py
1723
build:
1824
html:
19-
- cd doc && jupyter-book build --all
20-
commands:
25+
# --all builds frontmatter exports (PDF, per doc/myst.yml); --html is
26+
# required to produce the static HTML site (_build/html/index.html)
27+
# that RTD serves. The 3 commands previously sat in a separate
28+
# `commands:` block, which is not a valid `build.jobs.build` key in
29+
# RTD and caused config validation to fail before any commands ran.
30+
- cd doc && jupyter-book build --all --html
2131
- mkdir -p $READTHEDOCS_OUTPUT/html
22-
- cp -r doc/_build/site/* $READTHEDOCS_OUTPUT/html/
23-
24-
python:
25-
install:
26-
- method: pip
27-
path: .
28-
extra_requirements:
29-
- dev
32+
- cp -r doc/_build/html/* $READTHEDOCS_OUTPUT/html/

doc/getting_started/troubleshooting/deploy_hf_model_aml.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
"\n",
4848
"5. **AZURE_ML_MODEL_NAME_TO_DEPLOY**\n",
4949
" - If the model is listed in the AZURE ML Hugging Face model catalog, then supply the model name as shown in the following image.\n",
50-
" <br> <img src=\"./../../assets/aml_hf_model.png\" alt=\"AML Hugging Face model\" height=\"400\"/> <br>\n",
50+
" <br> <img src=\"./../../../assets/aml_hf_model.png\" alt=\"AML Hugging Face model\" height=\"400\"/> <br>\n",
5151
" - If you intend to deploy the model from the AZURE ML workspace model registry, then use the model name as shown in the subsequent image.\n",
52-
" <br> <img src=\"./../../assets/aml_ws_model.png\" alt=\"AML Workspace model\" height=\"400\"/> <br>\n",
52+
" <br> <img src=\"./../../../assets/aml_ws_model.png\" alt=\"AML Workspace model\" height=\"400\"/> <br>\n",
5353
"6. **AZURE_ML_MODEL_VERSION_TO_DEPLOY**\n",
5454
" - You can find the details of the model version in the images from previous step associated with the respective model.\n",
5555
"\n",
@@ -277,7 +277,7 @@
277277
"**Add deployment to an Azure ML endpoint created above**\n",
278278
"\n",
279279
"Please be aware that deploying, particularly larger models, may take some time. Once the deployment is finished, the provisioning state will be marked as 'Succeeded', as illustrated in the image below.\n",
280-
"<br> <img src=\"./../../assets/aml_endpoint_deployment.png\" alt=\"AML Endpoint Deployment\" height=\"400\"/> <br>"
280+
"<br> <img src=\"./../../../assets/aml_endpoint_deployment.png\" alt=\"AML Endpoint Deployment\" height=\"400\"/> <br>"
281281
]
282282
},
283283
{

doc/getting_started/troubleshooting/download_and_register_hf_model_aml.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"\n",
128128
"9. **AZURE_ML_COMPUTE_NAME**\n",
129129
" - If you already have an Azure ML compute cluster, provide its name. If not, the script will create one based on the instance size and the specified minimum and maximum instances.\n",
130-
" <br> <img src=\"./../../assets/aml_compute_cluster.png\" alt=\"AML compute cluster\" height=\"400\"/> <br>\n",
130+
" <br> <img src=\"./../../../assets/aml_compute_cluster.png\" alt=\"AML compute cluster\" height=\"400\"/> <br>\n",
131131
"\n",
132132
"10. **IDLE_TIME_BEFORE_SCALE_DOWN**\n",
133133
" - Set the duration for the Azure ML cluster to remain active before scaling down due to inactivity, ensuring efficient resource use. Typically, 3-4 hours is ideal for large size models.\n",

doc/getting_started/troubleshooting/score_aml_endpoint.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
"\n",
2626
"1. **AZURE_ML_SCORE_DEPLOYMENT_NAME**\n",
2727
" - This deployment name can be acquired from the Azure ML managed online endpoint, as illustrated in image below.\n",
28-
" <br> <img src=\"./../../assets/aml_deployment_name.png\" alt=\"AML Deployment Name\" height=\"400\"/> <br>\n",
28+
" <br> <img src=\"./../../../assets/aml_deployment_name.png\" alt=\"AML Deployment Name\" height=\"400\"/> <br>\n",
2929
"\n",
3030
"2. **AZURE_ML_MANAGED_ENDPOINT**\n",
3131
" - To obtain the managed endpoint, navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. Copy the REST endpoint as depicted below.\n",
32-
" <br> <img src=\"./../../assets/aml_score_uri.png\" alt=\"AML Score URI\" height=\"400\"/> <br>\n",
32+
" <br> <img src=\"./../../../assets/aml_score_uri.png\" alt=\"AML Score URI\" height=\"400\"/> <br>\n",
3333
"\n",
3434
"3. **AZURE_ML_KEY**\n",
3535
" - Navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. The primary key can be obtained as shown in the subsequent image.\n",
36-
" <br> <img src=\"./../../assets/aml_score_key.png\" alt=\"AML Score Key\" height=\"400\"/> <br>\n",
36+
" <br> <img src=\"./../../../assets/aml_score_key.png\" alt=\"AML Score Key\" height=\"400\"/> <br>\n",
3737
"\n"
3838
]
3939
},
@@ -80,7 +80,7 @@
8080
"**Azure ML endpoint JSON body**\n",
8181
"\n",
8282
"The JSON body can be acquired by the following method: Access the Hugging Face model within the Azure ML model catalog by going to the workspace, then to the studio, selecting 'Model Catalog', and using the search bar to find the model ID. Open the model to view the sample input schema as shown in the image below.\n",
83-
"<br> <img src=\"./../../assets/aml_model_endpoint_schema.png\" alt=\"aml_model_endpoint_schema.png\" height=\"400\"/> <br>\n",
83+
"<br> <img src=\"./../../../assets/aml_model_endpoint_schema.png\" alt=\"aml_model_endpoint_schema.png\" height=\"400\"/> <br>\n",
8484
"\n",
8585
"In addition, we have compiled the details of the request and response for the Hugging Face models hosted on the Azure Machine Learning (Azure ML) endpoint. Please review the [provided link](./hf_aml_model_endpoint_guide.md) to access the JSON request body and response for the Azure ML endpoint. Additionally, you can deduce the schema from the response if a bad request was sent to the inference endpoint."
8686
]

doc/myst.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ project:
201201
- file: api/pyrit_scenario.md
202202
- file: api/pyrit_score.md
203203
- file: api/pyrit_setup.md
204-
children:
205-
- file: api/pyrit_setup_initializers.md
206204
- file: api/pyrit_show_versions.md
207205
- file: api/pyrit_ui.md
208206
- file: blog/README.md

0 commit comments

Comments
 (0)