Skip to content

Commit c5c0e12

Browse files
Refactor wheel builder and improve platform-specific configs
Introduced platform-specific `packages.txt` files for better package management on Linux, macOS, and Windows. Updated documentation to reflect the new configuration approach.
1 parent 5d2c47e commit c5c0e12

File tree

5 files changed

+40
-44
lines changed

5 files changed

+40
-44
lines changed

scripts/wheelbuilder/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ that can then be built individually or in CI/CD systems like GitHub Actions.
2020
![](guide01.png)
2121

2222
4. Click on "Run workflow".
23-
You can enter a package name or build all packages.
24-
See [the platform subfolders](../../../../blob/master/scripts/wheelbuilder/) for which packages have buildscripts.
23+
You can enter a comma separated list of package names or build all packages.
24+
See [the platform subfolders](../../../../blob/master/scripts/wheelbuilder/) for which package are defined in the
25+
`packages.txt` files.
2526

2627
![](guide02.png)
2728
As download URL use the archive from the [release](https://github.com/oracle/graalpython/releases) page matching your
@@ -41,4 +42,4 @@ script generic for other platforms.
4142
Just run the `build_wheels.py` script.
4243
It expects a URL to download the GraalPy release from.
4344
You can set the environment variable `PACKAGES_TO_BUILD` to a comma-separated list of package build scripts you want to
44-
consider.
45+
consider.

scripts/wheelbuilder/build_wheels.py

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,19 @@ def create_venv():
104104

105105

106106
def build_wheels(pip):
107-
print("!!!!!!!!! PACKAGES_TO_BUILD= ", os.environ.get("PACKAGES_TO_BUILD", ""))
108107
packages_selected = [s for s in os.environ.get("PACKAGES_TO_BUILD", "").split(",") if s]
109-
print("!!!!!!!!!!! packages_selected", packages_selected, flush=True)
110108
packages_to_build = set()
111-
112-
if not packages_selected:
113-
with open(join(dirname(__file__), "packages.txt")) as f:
114-
for line in f.readlines():
115-
line = line.strip()
116-
name, version = line.split("==")
117-
if not packages_selected or name in packages_selected or line in packages_selected:
118-
packages_to_build.add(line)
119-
else:
120-
packages_to_build = packages_selected
121-
print("!!!!!!!! Building wheels for", packages_to_build, flush=True)
122109
scriptdir = abspath(join(dirname(__file__), sys.platform))
110+
with open(join(scriptdir, "packages.txt")) as f: # packages specific for the platform
111+
for line in f.readlines():
112+
line = line.strip()
113+
name, version = line.split("==")
114+
if not packages_selected or name in packages_selected or line in packages_selected:
115+
packages_to_build.add(line)
116+
if not packages_to_build:
117+
print("Building wheels failed, no packages selected", flush=True)
118+
return
119+
123120
if sys.platform == "win32":
124121
script_ext = "bat"
125122
else:
@@ -154,34 +151,25 @@ def build_wheels(pip):
154151

155152

156153
def repair_wheels():
157-
print("Repairing wheels")
158154
if sys.platform == "win32":
159-
print("This is my special output!!!!!!!!!!!!!!!!!!!!!")
160-
wheels = glob(join("wheelhouse", "*.whl"))
161-
if not wheels:
162-
print("No wheels found to repair.")
163-
return
164-
165-
for wheel in wheels:
166-
subprocess.check_call(["auditwheel", "repair", wheel, "-w", "wheelhouse/"])
167-
# ensure_installed("delvewheel")
168-
# env = os.environ.copy()
169-
# env["PYTHONUTF8"] = "1"
170-
# subprocess.check_call(
171-
# [
172-
# sys.executable,
173-
# "-m",
174-
# "delvewheel",
175-
# "repair",
176-
# "-v",
177-
# "--exclude",
178-
# "python-native.dll",
179-
# "-w",
180-
# "wheelhouse",
181-
# *glob("*.whl"),
182-
# ],
183-
# env=env,
184-
# )
155+
ensure_installed("delvewheel")
156+
env = os.environ.copy()
157+
env["PYTHONUTF8"] = "1"
158+
subprocess.check_call(
159+
[
160+
sys.executable,
161+
"-m",
162+
"delvewheel",
163+
"repair",
164+
"-v",
165+
"--exclude",
166+
"python-native.dll",
167+
"-w",
168+
"wheelhouse",
169+
*glob("*.whl"),
170+
],
171+
env=env,
172+
)
185173
elif sys.platform == "linux":
186174
ensure_installed("auditwheel")
187175
subprocess.check_call(
@@ -205,4 +193,4 @@ def repair_wheels():
205193
extract(outpath)
206194
pip = create_venv()
207195
build_wheels(pip)
208-
# repair_wheels()
196+
repair_wheels()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
numpy==1.26.4
2+
httptools==0.6.1
3+
kiwisolver==1.4.5
4+
psutil==5.9.8
5+
ujson==5.10.0
6+
xxhash==3.4.1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
numpy==2.0.2

0 commit comments

Comments
 (0)