potiuk commented on code in PR #37444:
URL: https://github.com/apache/airflow/pull/37444#discussion_r1491057063


##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -374,6 +404,58 @@ def _build_airflow_packages_with_hatch(
     )
 
 
+def _dist_packages(
+    *, package_format: str, build_type: Literal["airflow", "providers"]
+) -> Iterator[DistributionPackageInfo]:
+    if build_type == "airflow":
+        default_glob_pattern = "apache[_-]airflow-[0-9]"
+    else:
+        default_glob_pattern = "apache[_-]airflow[_-]providers"
+
+    if package_format in ["sdist", "both"]:
+        for file in DIST_DIR.glob(f"{default_glob_pattern}*tar.gz"):
+            if not file.is_file():
+                continue
+            yield DistributionPackageInfo.from_sdist(filepath=file)
+    if package_format in ["wheel", "both"]:
+        for file in DIST_DIR.glob(f"{default_glob_pattern}*whl"):
+            if not file.is_file():
+                continue
+            yield DistributionPackageInfo.from_wheel(filepath=file)
+
+
+def _check_sdist_to_wheel(dist_info: DistributionPackageInfo):
+    if dist_info.dist_type != "sdist":
+        return
+
+    with tempfile.TemporaryDirectory() as tmp_dir_name:
+        venv_path = Path(tmp_dir_name) / ".venv"
+        venv.EnvBuilder(with_pip=True).create(venv_path)
+        python_path = venv_path / "bin" / "python"
+        if not python_path.exists():
+            msg = f"Python interpreter is not exist in path {python_path}"
+            raise FileNotFoundError(msg)

Review Comment:
   venv is fine - this method is run by release manager only, and we can have 
**some** expectations about it. Also by default - even if this method is run by 
regular contributor, it only creates whl file so it's 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