@@ -96,65 +96,30 @@ const installRuntimeDependencies = (runtimePython) => {
9696 throw new Error ( `Backend requirements file does not exist: ${ requirementsPath } ` ) ;
9797 }
9898
99- const runPipInstall = ( extraArgs = [ ] ) => {
100- const installArgs = [
101- '-m' ,
102- 'pip' ,
103- '--disable-pip-version-check' ,
104- 'install' ,
105- '--no-cache-dir' ,
106- '-r' ,
107- requirementsPath ,
108- ...extraArgs ,
109- ] ;
110- const installResult = spawnSync ( runtimePython . absolute , installArgs , {
111- cwd : outputDir ,
112- stdio : [ 'ignore' , 'pipe' , 'pipe' ] ,
113- encoding : 'utf8' ,
114- windowsHide : true ,
115- } ) ;
116- if ( installResult . stdout ) {
117- process . stdout . write ( installResult . stdout ) ;
118- }
119- if ( installResult . stderr ) {
120- process . stderr . write ( installResult . stderr ) ;
121- }
122- return installResult ;
123- } ;
124-
125- let installResult = runPipInstall ( ) ;
99+ const installArgs = [
100+ '-m' ,
101+ 'pip' ,
102+ '--disable-pip-version-check' ,
103+ 'install' ,
104+ '--no-cache-dir' ,
105+ '-r' ,
106+ requirementsPath ,
107+ ] ;
108+ const installResult = spawnSync ( runtimePython . absolute , installArgs , {
109+ cwd : outputDir ,
110+ stdio : 'inherit' ,
111+ windowsHide : true ,
112+ } ) ;
126113 if ( installResult . error ) {
127114 throw new Error (
128115 `Failed to install backend runtime dependencies: ${ installResult . error . message } ` ,
129116 ) ;
130117 }
131- if ( installResult . status === 0 ) {
132- return ;
133- }
134-
135- const outputText = `${ installResult . stderr || '' } \n${ installResult . stdout || '' } ` ;
136- const shouldRetryWithBreakSystemPackages =
137- outputText . includes ( 'externally-managed-environment' ) ||
138- outputText . includes ( 'This environment is externally managed' ) ;
139-
140- if ( shouldRetryWithBreakSystemPackages ) {
141- console . warn (
142- 'Detected externally managed Python runtime; retrying pip install with --break-system-packages.' ,
118+ if ( installResult . status !== 0 ) {
119+ throw new Error (
120+ `Backend runtime dependency installation failed with exit code ${ installResult . status } .` ,
143121 ) ;
144- installResult = runPipInstall ( [ '--break-system-packages' ] ) ;
145- if ( installResult . error ) {
146- throw new Error (
147- `Failed to install backend runtime dependencies: ${ installResult . error . message } ` ,
148- ) ;
149- }
150- if ( installResult . status === 0 ) {
151- return ;
152- }
153122 }
154-
155- throw new Error (
156- `Backend runtime dependency installation failed with exit code ${ installResult . status } .` ,
157- ) ;
158123} ;
159124
160125const main = ( ) => {
0 commit comments