Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
aa7c65b
feat: add build command
parthea Jul 22, 2025
3933663
lint
parthea Jul 22, 2025
8178b9f
update comment
parthea Jul 22, 2025
4653b5b
Merge branch 'main' of https://github.com/googleapis/google-cloud-pyt…
parthea Jul 23, 2025
ea31579
increase timeout to 2 hours
parthea Jul 23, 2025
0e89af2
update test
parthea Jul 23, 2025
a4e6e73
update build command to run tests for a specific library
parthea Jul 23, 2025
598660e
remove return_value
parthea Jul 23, 2025
4f5ec1f
Add TODO comment to reduce docker build duration
parthea Jul 23, 2025
2fbefc0
update exception message
parthea Jul 23, 2025
80007ba
lint
parthea Jul 23, 2025
9d129c8
add type hints
parthea Jul 23, 2025
3f9b48c
refactor common code
parthea Jul 23, 2025
b9b11b0
remove capture output
parthea Jul 23, 2025
917cda9
refactor
parthea Jul 23, 2025
6935737
Merge branch 'main' into add-build-command
parthea Jul 23, 2025
e3580ca
create alias for 3.13.5
parthea Jul 23, 2025
bb6e8d1
fix build
parthea Jul 23, 2025
33207f9
fix build
parthea Jul 23, 2025
a041f2d
fix build
parthea Jul 24, 2025
17fe1c3
fix build
parthea Jul 24, 2025
eb80f09
for testing purposes
parthea Jul 24, 2025
3a1a40f
fix build
parthea Jul 24, 2025
e9914b0
Merge branch 'main' into add-build-command
parthea Jul 24, 2025
f3235e2
restore import
parthea Jul 24, 2025
a2cc75b
restore import
parthea Jul 24, 2025
fce74ed
add type hint
parthea Jul 24, 2025
e36ba3f
use repo dir
parthea Jul 24, 2025
1ea260e
add tests for get_library_id
parthea Jul 24, 2025
8bbe2ad
add tests for _run_individual_session
parthea Jul 24, 2025
9e6c7de
add tests for _run_nox_sessions
parthea Jul 24, 2025
1ec6294
run isort/black
parthea Jul 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,47 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Set up environment variables for tool versions to make updates easier.
ENV PYTHON_VERSION=3.11.5

# Create a symbolic link for `python3` to point to our specific version.
ENV PATH /usr/local/bin/python3.11:$PATH

RUN for PYTHON_VERSION in 3.9.23 3.10.18 3.11.13 3.12.11 3.13.5; do \
# Install Python from source
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
tar -xvf Python-${PYTHON_VERSION}.tgz && \
cd Python-${PYTHON_VERSION} && \
./configure --enable-optimizations && \
make altinstall && \
cd / && \
rm -rf Python-${PYTHON_VERSION}*
rm -rf Python-${PYTHON_VERSION}* \
; done

ENV PYTHON_PIP_VERSION 25.1.1
RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.10 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \

# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python
# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages")
# https://github.com/docker-library/python/pull/143#issuecomment-241032683
&& pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \

# then we use "pip list" to ensure we don't have more than one pip version installed
# https://github.com/docker-library/python/pull/100
&& [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ]

# Ensure Pip for all python3 versions
RUN python3.9 /tmp/get-pip.py
RUN python3.11 /tmp/get-pip.py
RUN python3.12 /tmp/get-pip.py
RUN python3.13 /tmp/get-pip.py

RUN rm /tmp/get-pip.py

# Test Pip
RUN python3.9 -m pip
RUN python3.10 -m pip
RUN python3.11 -m pip
RUN python3.12 -m pip
RUN python3.13 -m pip


# TODO(https://github.com/googleapis/librarian/issues/904): Install protoc for gencode.

Expand Down
21 changes: 19 additions & 2 deletions .generator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import argparse
import json
import logging
import os
import subprocess
import sys

logger = logging.getLogger()
Expand Down Expand Up @@ -73,7 +73,24 @@ def handle_generate():


def handle_build():
# TODO(https://github.com/googleapis/librarian/issues/450): Implement build command and update docstring.
"""The main coordinator for validating client library generation."""
sesssions = [
"unit-3.9",
"unit-3.10",
"unit-3.11",
"unit-3.12",
"unit-3.13",
"docs",
"system",
"lint",
"lint_setup_py",
"mypy",
"check_lower_bounds",
]
for nox_session in sesssions:
command = ["nox", "-s", nox_session]
result = subprocess.run(command, capture_output=True, text=True, check=True)
logger.info(result)
logger.info("'build' command executed.")


Expand Down
Loading