Skip to content

Commit

Permalink
chore(python): use python 3.10 for docs build (#1989)
Browse files Browse the repository at this point in the history
* chore(python): fix docs build

* upgrade python 3.9; add python 3.10

* remove python 3.9; use python 3.10 for docs build

* address review feedback

* clarify comment
  • Loading branch information
parthea authored Jul 8, 2024
1 parent 0142f35 commit 9ae0785
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ RUN apt-get update \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
python3-distutils \
redis-server \
software-properties-common \
ssh \
Expand All @@ -60,18 +59,22 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb

###################### Install python 3.9.13

# Download python 3.9.13
RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
###################### Install python 3.10.14 for docs/docfx session

# Download python 3.10.14
RUN wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz

# Extract files
RUN tar -xvf Python-3.9.13.tgz
RUN tar -xvf Python-3.10.14.tgz

# Install python 3.9.13
RUN ./Python-3.9.13/configure --enable-optimizations
# Install python 3.10.14
RUN ./Python-3.10.14/configure --enable-optimizations
RUN make altinstall

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

###################### Install pip
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3 /tmp/get-pip.py \
Expand All @@ -84,4 +87,4 @@ RUN python3 -m pip
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --require-hashes -r requirements.txt

CMD ["python3.8"]
CMD ["python3.10"]
2 changes: 1 addition & 1 deletion synthtool/gcp/templates/python_library/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python="3.9")
@nox.session(python="3.10")
def docs(session):
"""Build the docs for this library."""

Expand Down

0 comments on commit 9ae0785

Please sign in to comment.