googleapis / synthtool

Apache License 2.0
87 stars 82 forks source link

chore(python): use python 3.10 for docs build #1989

Closed parthea closed 1 month ago

parthea commented 1 month ago

This PR fixes the issue E: Package 'python3-distutils' has no installation candidate which can be seen in this build log from PR https://github.com/googleapis/python-pubsub/pull/1220.

This PR also updates the default python version to be 3.10 for the docs session to match what we use for docfx. https://github.com/googleapis/synthtool/blob/0142f3529bd44e1bd7297e72ac6d0c8228bf1489/synthtool/gcp/templates/python_library/noxfile.py.j2#L358-L359

https://github.com/googleapis/synthtool/blob/0142f3529bd44e1bd7297e72ac6d0c8228bf1489/synthtool/gcp/templates/python_library/noxfile.py.j2#L393-L394

I tested that this build successfully by running docker build -t test_docs . in the directory synthtool/gcp/templates/python_library/.kokoro/docker/docs/

I then ran the following nox sessions docs and docfx.

Note: The both the docs and docfx session now require Python 3.10.

docker run --rm -it --entrypoint /bin/bash test_docs

Then in the docker image, run the following commands

git clone https://github.com/googleapis/python-pubsub.git
cd python-pubsub
nox -s docs
nox -s docfx