File tree Expand file tree Collapse file tree 3 files changed +22
-18
lines changed
Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -50,21 +50,11 @@ RUN for PYTHON_VERSION in 3.9.23 3.10.18 3.11.13 3.12.11 3.13.5; do \
5050 rm -rf Python-${PYTHON_VERSION}* \
5151 ; done
5252
53- ENV PYTHON_PIP_VERSION 25.1.1
54- RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
55- && python3.10 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \
56-
57- # 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
58- # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages")
59- # https://github.com/docker-library/python/pull/143#issuecomment-241032683
60- && pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \
61-
62- # then we use "pip list" to ensure we don't have more than one pip version installed
63- # https://github.com/docker-library/python/pull/100
64- && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == " pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ]
53+ RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py'
6554
6655# Ensure Pip for all python3 versions
6756RUN python3.9 /tmp/get-pip.py
57+ RUN python3.10 /tmp/get-pip.py
6858RUN python3.11 /tmp/get-pip.py
6959RUN python3.12 /tmp/get-pip.py
7060RUN python3.13 /tmp/get-pip.py
Original file line number Diff line number Diff line change 1818import subprocess
1919import sys
2020import subprocess
21+ from typing import List
2122
2223logger = logging .getLogger ()
2324
@@ -113,9 +114,21 @@ def handle_generate():
113114 logger .info ("'generate' command executed." )
114115
115116
117+ def _run_nox_sessions (sessions :List [str ]):
118+ """Calls nox with the specified sessions.
119+
120+ Args:
121+ path (List[str]): The list of nox sessions to run.
122+ """
123+ for nox_session in sessions :
124+ command = ["nox" , "-s" , nox_session ]
125+ result = subprocess .run (command , capture_output = True , text = True , check = True )
126+ logger .info (result )
127+
128+
116129def handle_build ():
117130 """The main coordinator for validating client library generation."""
118- sesssions = [
131+ sessions = [
119132 "unit-3.9" ,
120133 "unit-3.10" ,
121134 "unit-3.11" ,
@@ -128,10 +141,8 @@ def handle_build():
128141 "mypy" ,
129142 "check_lower_bounds" ,
130143 ]
131- for nox_session in sesssions :
132- command = ["nox" , "-s" , nox_session ]
133- result = subprocess .run (command , capture_output = True , text = True , check = True )
134- logger .info (result )
144+ _run_nox_sessions (sessions )
145+
135146 logger .info ("'build' command executed." )
136147
137148
Original file line number Diff line number Diff line change @@ -117,12 +117,15 @@ def test_handle_generate_fail(caplog):
117117 handle_generate ()
118118
119119
120- def test_handle_build_success (caplog , mock_generate_request_file ):
120+ def test_handle_build_success (caplog , mocker ):
121121 """
122122 Tests the successful execution path of handle_build.
123123 """
124124 caplog .set_level (logging .INFO )
125125
126+ mocker .patch (
127+ "cli._run_nox_sessions" , return_value = "mock-result"
128+ )
126129 handle_build ()
127130
128131 assert "'build' command executed." in caplog .text
You can’t perform that action at this time.
0 commit comments