Skip to content

Commit

Permalink
Merge pull request AdaCore#605 from leocardao/mr/cardao/update-e3-pyp…
Browse files Browse the repository at this point in the history
…i-closure

e3-pypi-closure: Use `pip wheel` to build wheels
  • Loading branch information
leocardao authored Feb 27, 2024
2 parents e428096 + 06d189b commit c55d718
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/e3/python/wheel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations
import os
import sys
import zipfile
import tempfile
from pkg_resources import Requirement
Expand Down Expand Up @@ -54,23 +53,26 @@ def build(cls, source_dir: str, dest_dir: str, python_tag: str = "py3") -> Wheel
"""
with tempfile.TemporaryDirectory() as build_dir:
p = Run(
[
sys.executable,
"./setup.py",
python_script("pip")
+ [
"wheel",
".",
"-q",
"bdist_wheel",
f"--python-tag={python_tag}",
"-d",
"--no-deps",
f"-C--python-tag={python_tag}",
"-w",
build_dir,
],
cwd=source_dir,
)

if p.status != 0:
raise WheelError(f"Error during wheel creation:\n{p.out}")

tmp_whl_path = ls(os.path.join(build_dir, "*.whl"))[0]
dest_whl_path = os.path.join(dest_dir, os.path.basename(tmp_whl_path))
mv(tmp_whl_path, dest_whl_path)

return Wheel(path=dest_whl_path)

def install(self) -> None:
Expand Down

0 comments on commit c55d718

Please sign in to comment.