uranusjr commented on a change in pull request #19992:
URL: https://github.com/apache/airflow/pull/19992#discussion_r762536434



##########
File path: Breeze2
##########
@@ -41,11 +43,21 @@ def save_config():
 
 if needs_installation():
     print(f"(Re)Installing Breeze's virtualenv in {BUILD_BREEZE_VENV_DIR}")
-    BUILD_BREEZE_VENV_DIR.mkdir(parents=True, exist_ok=True)
-    subprocess.run([sys.executable, "-m", "venv", f"{BUILD_BREEZE_VENV_DIR}"], 
check=True)
-    subprocess.run(
-        [f"{BUILD_BREEZE_VENV_PIP}", "install", "--upgrade", "-e", "."], 
cwd=BREEZE_SOURCE_PATH, check=True
+    EnvBuilder(system_site_packages=False, upgrade=True, with_pip=True, 
prompt="breeze").create(
+        str(BUILD_BREEZE_VENV_DIR)
     )
+    if os.name == 'nt':
+        subprocess.run(
+            [f"{BUILD_BREEZE_VENV_PYTHON}.exe", "-m", "pip", "install", 
"--upgrade", "-e", "."],
+            cwd=BREEZE_SOURCE_PATH,
+            check=True,
+        )
+    else:
+        subprocess.run(
+            [f"{BUILD_BREEZE_VENV_PYTHON}", "-m", "pip", "install", 
"--upgrade", "-e", "."],
+            cwd=BREEZE_SOURCE_PATH,
+            check=True,
+        )

Review comment:
       Not with venv (it is very barebone), but if you use virtualenv there is 
a thing called 
[seeders](https://virtualenv.pypa.io/en/latest/cli_interface.html#section-seeder).
   
   Installing things on environment creation is out of pip’s control because it 
needs hooks in the environment builder, and venv does not provide that.




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