Taragolis commented on code in PR #37476: URL: https://github.com/apache/airflow/pull/37476#discussion_r1492390429
########## dev/breeze/src/airflow_breeze/commands/release_management_commands.py: ########## @@ -374,6 +403,99 @@ 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_dists(dists_info: tuple[DistributionPackageInfo, ...]): + venv_created = False + success_build = True + with tempfile.TemporaryDirectory() as tmp_dir_name: + for di in dists_info: + if di.dist_type != "sdist": + continue + + if not venv_created: + venv_path = (Path(tmp_dir_name) / ".venv").resolve().absolute() + venv_command_result = run_command( + [sys.executable, "-m", "venv", venv_path.__fspath__()], + check=False, + capture_output=True, + ) + if venv_command_result.returncode != 0: + get_console().print( + f"[error]Error when initializing virtualenv in {venv_path.__fspath__()}:[/]\n" + f"{venv_command_result.stdout}\n{venv_command_result.stderr}" + ) Review Comment: Installing from venv module was finish with error, which very difficult to debug, maybe some unknown side effect. Switch to subprocess, and seems it works 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org