mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-27 23:39:58 +00:00
05e5a375f5
Noticed after 5b00c8b45 - build started to break. `--py313` is not needed here, since wasm build doesn't really depend on the provided Python versions and just builds the version it picks up from `pyodide`.
There are two ways to build pyodide ifcopenshell Python wrapper wheel.
- Using pyodide build system (
build_pyodide.ymldoes it):
- install prebuilt pyodide build and emscripten environment (see
build_pyodide.sh) - clone IfcOpenShell to
IfcOpenShellfolder - create
packages/ifcopenshellfolder that will be used by pyodide build system - from
IfcOpenShellmove building recipepyodide/meta.yamltopackages/ifcopenshell - run
pyodide build-recipes ifcopenshell --install, it will- execute
meta.yamlrecipe - it will:- copy IfcOpenShell source to build folder
packages/ifcopenhell/build/ifcopenshell-0.8.0 - build ifcopenshell and its dependencies
- note that rerunning
pyodide build-recipeswill remove previous build folder and rebuild all dependencies.
The way to avoid it, if build fails, is to usepyodide build-recipes-no-deps ifcopenshell --continueinstead.
- copy IfcOpenShell source to build folder
- run
setup.pyinIfcOpenShellroot, producing a wheel inIfcOpenShell/dist - copy that wheel to
packages/ifcopenshell/dist --installit to current build envrionment- copy the wheel next to
distfolder (in root directory, next topackages) - add wheel to
dist/pyodide-lock.json
- copy the wheel next to
- execute
- Build it outside of pyodide build system.
Building inside pyodide build system should be preferred, option to build it outside is useful for debugging purposes, since it's pure cmake without any additional moving parts.
- setup pyodide environment, see above
- clone IfcOpenShell repo next to it to
IfcOpenShellfolder - run
python nix/build-all.py -wasm -py-313inIfcOpenShell- it will produce Python package in
IfcOpenShell/ifcopenshell
- it will produce Python package in
- run
python pyodide/build-all-pack-wheel-local.py, it will- clean up previous wheels
- run
pyodide build - prepare standalone and modular wheels
- produce final wheels in
IfcOpenShell/distandIfcOpenshell/dist-modular
- testing:
- ensure you're in pyodide environment
cd IfcOpenshell/pyodide./run_pytest.py setup./run_pytest.py run