mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Add script to quickly pack wasm wheel after local build-all
This commit is contained in:
+5
-2
@@ -28,8 +28,11 @@ since it's pure cmake without any additional moving parts.
|
|||||||
- clone IfcOpenShell repo next to it to `IfcOpenShell` folder
|
- clone IfcOpenShell repo next to it to `IfcOpenShell` folder
|
||||||
- run `python nix/build-all.py -wasm -py-313` in `IfcOpenShell`
|
- run `python nix/build-all.py -wasm -py-313` in `IfcOpenShell`
|
||||||
- it will produce Python package in `IfcOpenShell/ifcopenshell`
|
- it will produce Python package in `IfcOpenShell/ifcopenshell`
|
||||||
- run `pyodide build`
|
- run `python pyodide/build-all-pack-wheel-local.py`, it will
|
||||||
- it will produce a wheel in `IfcOpenShell/dist`
|
- clean up previous wheels
|
||||||
|
- run `pyodide build`
|
||||||
|
- prepare standalone and modular wheels
|
||||||
|
- produce final wheels in `IfcOpenShell/dist` and `IfcOpenshell/dist-modular`
|
||||||
- testing:
|
- testing:
|
||||||
- ensure you're in pyodide environment
|
- ensure you're in pyodide environment
|
||||||
- `cd IfcOpenshell/pyodide`
|
- `cd IfcOpenshell/pyodide`
|
||||||
|
|||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Intended to be run after nix/build-all.py has finished the wasm build."""
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def get_repo_root() -> Path:
|
||||||
|
output = subprocess.check_output(["git", "rev-parse", "--show-toplevel"], text=True)
|
||||||
|
return Path(output.strip())
|
||||||
|
|
||||||
|
|
||||||
|
def run(cmd: list[str], **kwargs) -> None:
|
||||||
|
print("$", " ".join(cmd))
|
||||||
|
subprocess.check_call(cmd, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
repo_root = get_repo_root()
|
||||||
|
|
||||||
|
shutil.rmtree(repo_root / "dist", ignore_errors=True)
|
||||||
|
shutil.rmtree(repo_root / "dist_modular", ignore_errors=True)
|
||||||
|
run(["pyodide", "build"], cwd=repo_root)
|
||||||
|
shutil.rmtree(repo_root / "ifcopenshell", ignore_errors=True)
|
||||||
|
(repo_root / "setup.py").unlink(missing_ok=True)
|
||||||
|
run(["git", "restore", "pyproject.toml"], cwd=repo_root)
|
||||||
|
|
||||||
|
wheel = next((repo_root / "dist").glob("ifcopenshell-*.whl"))
|
||||||
|
|
||||||
|
run(["uv", "run", "pyodide/order_pyodide_wheel_shared_objects.py", str(wheel)], cwd=repo_root)
|
||||||
|
run(
|
||||||
|
["uv", "run", "pyodide/split_pyodide_ifcopenshell_wheel.py", str(wheel), "dist-modular/"],
|
||||||
|
cwd=repo_root,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user