gemini-code-assist[bot] commented on code in PR #38862:
URL: https://github.com/apache/beam/pull/38862#discussion_r3380769222


##########
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy:
##########
@@ -3143,9 +3143,11 @@ class BeamModulePlugin implements Plugin<Project> {
           if (extra) {
             installTargets = "${distTarBall}[${packages},${extra}]"
           }
+          def uvCacheDir = "${project.ext.envdir}/.uv_cache"
           project.exec {
             executable 'sh'
-            args '-c', ". ${project.ext.envdir}/bin/activate && pip install uv 
&& uv pip install --pre ${installTargets}"
+            // Default uv cache is global; py310/py314 installGcpTest fight 
over the same lock.
+            args '-c', ". ${project.ext.envdir}/bin/activate && pip install uv 
&& uv pip install --cache-dir ${uvCacheDir} --pre ${installTargets}"
           }

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   If the project path or virtual environment directory (`envdir`) contains 
spaces (which is common in local development environments), executing the shell 
command without quotes will fail. It is safer to wrap the paths in double 
quotes within the shell command to ensure robustness.
   
   ```
             def uvCacheDir = "${project.ext.envdir}/.uv_cache"
             project.exec {
               executable 'sh'
               // Default uv cache is global; py310/py314 installGcpTest fight 
over the same lock.
               args '-c', ". \"${project.ext.envdir}/bin/activate\" && pip 
install uv && uv pip install --cache-dir \"${uvCacheDir}\" --pre 
\"${installTargets}\""
             }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to