Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/psm-interop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.10", "3.11"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
permissions:
pull-requests: read # Used by paths-filter to read the diff.
Expand Down Expand Up @@ -81,14 +81,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'

- name: Install dependencies
run: |
pip list
python -m pip install --upgrade pip
pip install pylint==2.2.2 astroid==2.3.3 toml==0.10.2 "isort>=4.3.0,<5.0.0"
pip install pylint astroid toml isort
pip list
- name: Analysing source code with pylint
run: |
Expand Down
21 changes: 12 additions & 9 deletions .kokoro/psm_interop_kokoro_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ readonly TEST_DRIVER_PATH=""
readonly TEST_DRIVER_PROTOS_PATH="protos/grpc/testing"

# --- Injectable constants ---
readonly PYTHON_VERSION="${PYTHON_VERSION:-3.10}"
readonly PYTHON_VERSION="${PYTHON_VERSION:-3.11}"

# Test driver
readonly TEST_DRIVER_REPO_OWNER="${TEST_DRIVER_REPO_OWNER:-grpc}"
Expand Down Expand Up @@ -1205,21 +1205,21 @@ test_driver_pip_install() {
psm::tools::log "Found python virtual environment directory: ${venv_dir}"
else
psm::tools::log "Creating python virtual environment: ${venv_dir}"
"python${PYTHON_VERSION}" -m venv "${venv_dir}" --upgrade-deps
uv venv --python "${PYTHON_VERSION}" --seed "${venv_dir}"
fi
# Intentional: No need to check python venv activate script.
# shellcheck source=/dev/null
source "${venv_dir}/bin/activate"
fi

psm::tools::log "Installing Python packages with pip, see install-pip.log"
psm::tools::log "Installing Python packages with uv pip, see install-pip.log"
psm::driver::pip_install &>> "${BUILD_LOGS_ROOT}/install-pip.log"
}

psm::driver::pip_install() {
psm::tools::run_verbose python3 -m pip install -r requirements.lock
psm::tools::run_verbose uv pip install -r requirements.lock
echo
psm::tools::run_verbose python3 -m pip list
psm::tools::run_verbose uv pip list
}

#######################################
Expand All @@ -1246,7 +1246,7 @@ test_driver_compile_protos() {
)
psm::tools::log "Generate python code from grpc.testing protos: ${protos[*]}"
cd "${TEST_DRIVER_REPO_DIR}"
python3 -m grpc_tools.protoc \
python -m grpc_tools.protoc \
--proto_path=. \
--python_out="${TEST_DRIVER_FULL_DIR}" \
--grpc_python_out="${TEST_DRIVER_FULL_DIR}" \
Expand Down Expand Up @@ -1289,8 +1289,7 @@ test_driver_install() {
kokoro_print_version() {
psm::tools::log "Kokoro Ubuntu version:"
run_ignore_exit_code lsb_release -a
run_ignore_exit_code "python${PYTHON_VERSION}" --version
run_ignore_exit_code "python${PYTHON_VERSION}" -m pip --version

}

#######################################
Expand Down Expand Up @@ -1360,11 +1359,15 @@ kokoro_install_dependencies() {
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq remove needrestart
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install --auto-remove \
"python${PYTHON_VERSION}-venv" \
google-cloud-sdk-gke-gcloud-auth-plugin \
kubectl \
parallel
sudo rm -rf /var/lib/apt/lists
sudo python3 -m pip install uv
uv python install "${PYTHON_VERSION}"
psm::tools::log "uv version:"
uv --version
uv run --python "${PYTHON_VERSION}" python --version
}

#######################################
Expand Down
12 changes: 2 additions & 10 deletions bin/freeze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,5 @@

set -exo pipefail

VENV_NAME="venv-$(mktemp -d)"
readonly VENV_NAME

python3 -m virtualenv "${VENV_NAME}"

"${VENV_NAME}"/bin/pip install -r requirements.txt
"${VENV_NAME}"/bin/pip freeze --require-virtualenv --local -r requirements.txt \
> requirements.lock

rm -rf "${VENV_NAME}"
# Make sure uv is installed: curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip compile requirements.txt --python-version 3.11 -o requirements.lock
4 changes: 2 additions & 2 deletions bin/pylint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ USAGE:
./bin/pylint.sh

ONE-TIME INSTALLATION:
1. python3.10 -m venv --upgrade-deps venv-pylint
1. python3.11 -m venv --upgrade-deps venv-pylint
2. source ./venv-pylint/bin/activate
3. pip install pylint==2.2.2 astroid==2.3.3 toml==0.10.2 "isort>=4.3.0,<5.0.0"
3. pip install pylint astroid toml isort
4. deactivate

ENVIRONMENT:
Expand Down
5 changes: 1 addition & 4 deletions framework/helpers/retryers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import tenacity
from tenacity import _utils as tenacity_utils
from tenacity import compat as tenacity_compat
from tenacity import stop
from tenacity import wait
from tenacity.retry import retry_base
Expand Down Expand Up @@ -235,9 +234,7 @@ def log_it(retry_state):
verb, value = "raised", "%s: %s" % (type(ex).__name__, ex)

if exc_info:
local_exc_info = tenacity_compat.get_exc_info_from_future(
retry_state.outcome
)
local_exc_info = ex
else:
local_exc_info = False
else:
Expand Down
2 changes: 1 addition & 1 deletion framework/test_app/runners/k8s/k8s_base_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ def _wait_pod_started(self, name, **kwargs) -> k8s.V1Pod:
self.k8s_namespace.wait_for_pod_started(name, **kwargs)
pod = self.k8s_namespace.get_pod(name)

pod_ips = pod.status.pod_i_ps or pod.status.pod_ip
pod_ips = pod.status.pod_ips or pod.status.pod_ip
logger.info("Pod %s ready, IP: %s", pod.metadata.name, pod_ips)
return pod

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[tool.black]
line-length = 80
target-version = [
"py310",
"py311",
]
target-version = ["py311"]

[tool.isort]
profile = "black"
Expand Down
Loading
Loading