gopidesupavan commented on code in PR #43612:
URL: https://github.com/apache/airflow/pull/43612#discussion_r1828377367


##########
providers/src/airflow/providers/standard/utils/python_virtualenv.py:
##########
@@ -88,22 +145,33 @@ def prepare_virtualenv(
     if pip_install_options is None:
         pip_install_options = []
 
+    if requirements is not None and requirements_file_path is not None:
+        raise ValueError("Either requirements OR requirements_file_path has to 
be passed, but not both")
+
     if index_urls is not None:
         _generate_pip_conf(Path(venv_directory) / "pip.conf", index_urls)
 
-    venv_cmd = _generate_venv_cmd(venv_directory, python_bin, 
system_site_packages)
+    if _use_uv():
+        venv_cmd = _generate_uv_cmd(venv_directory, python_bin, 
system_site_packages)
+    else:
+        venv_cmd = _generate_venv_cmd(venv_directory, python_bin, 
system_site_packages)
     execute_in_subprocess(venv_cmd)
 
-    if requirements is not None and requirements_file_path is not None:
-        raise ValueError("Either requirements OR requirements_file_path has to 
be passed, but not both")
-
     pip_cmd = None
     if requirements is not None and len(requirements) != 0:
-        pip_cmd = _generate_pip_install_cmd_from_list(venv_directory, 
requirements, pip_install_options)
+        if _use_uv():
+            pip_cmd = _generate_uv_install_cmd_from_list(venv_directory, 
requirements, pip_install_options)
+        else:
+            pip_cmd = _generate_pip_install_cmd_from_list(venv_directory, 
requirements, pip_install_options)
     if requirements_file_path is not None and requirements_file_path:

Review Comment:
   ```suggestion
       else:
   ```
   Line: 149 already checks if both requirement/requirement_file_path provided 
it raise exception, so in this case here else block is fine :) ?
   



-- 
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