Skip to content

Commit

Permalink
build: fix docs build (#12965)
Browse files Browse the repository at this point in the history
This PR fixes the docs build which started failing as of
#12634 and
#12881.

I tested these changes by re-triggering a docs build which previously
failed, with the changes from this PR.

See related PR googleapis/synthtool#1996 and
related issue b/356444150
  • Loading branch information
parthea authored Jul 31, 2024
1 parent 60d0728 commit b316a6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ RUN tar -xvf Python-3.10.14.tgz
RUN ./Python-3.10.14/configure --enable-optimizations
RUN make altinstall

RUN python3.10 -m venv /venv
ENV PATH /venv/bin:$PATH
ENV PATH /usr/local/bin/python3.10:$PATH

###################### Install pip
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3 /tmp/get-pip.py \
&& python3.10 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

# Test pip
Expand Down
16 changes: 8 additions & 8 deletions .kokoro/publish-docs-single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ pwd
nox -s docs

# create metadata
python3.9 -m docuploader create-metadata \
python3.10 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--version=$(python3.10 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--distribution-name=$(python3.10 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3.9 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"
python3.10 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"


# docfx yaml files
nox -s docfx

# create metadata.
python3.9 -m docuploader create-metadata \
python3.10 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--version=$(python3.10 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--distribution-name=$(python3.10 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)
Expand All @@ -64,4 +64,4 @@ else
fi

# upload docs
python3.9 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${staging_v2_bucket}"
python3.10 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${staging_v2_bucket}"
4 changes: 2 additions & 2 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ RETVAL=0
export PROJECT_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)

# Install nox
python3.9 -m pip install --require-hashes -r "$PROJECT_ROOT/.kokoro/requirements.txt"
python3.9 -m nox --version
python3.10 -m pip install --require-hashes -r "$PROJECT_ROOT/.kokoro/requirements.txt"
python3.10 -m nox --version

# A file for publishing docs
publish_docs_script="${PROJECT_ROOT}/.kokoro/publish-docs-single.sh"
Expand Down

0 comments on commit b316a6a

Please sign in to comment.