File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 4949 ifcopenshell_build/*/*/logs/*.log
5050 retention-days : 30
5151
52+ - name : Run wheel tests
53+ run : |
54+ cp -r IfcOpenShell/pyodide/test test
55+ # venv set up in build_pyodide.sh.
56+ source .venv/bin/activate
57+ uv pip install pytest-pyodide
58+ PYODIDE_ROOT_DIST=`pyodide config get pyodide_root`/dist
59+ # `pytest-pyodide` requires pyodide in 'pyodide' directory in cwd, when running `pytest`.
60+ cp -r $PYODIDE_ROOT_DIST test/pyodide
61+ cp dist/ifcopenshell-*.whl test/pyodide
62+ cd test
63+ pytest --capture=no
64+
5265 - name : Pack Dependencies
5366 run : |
5467 cd ifcopenshell_build
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+
4+ WHEEL_FILENAME = next (
5+ p .name for p in (Path .cwd () / "pyodide" ).iterdir () if p .name .startswith ("ifcopenshell-" ) and p .suffix == ".whl"
6+ )
7+
8+
9+ def test_ifcopenshell_import (selenium ):
10+ selenium .load_package ("micropip" )
11+ # Important to test it with `micropip.install`
12+ # without any dependencies loaded to ensure micropip will load them automatically.
13+ selenium .run_async (
14+ f"""
15+ import micropip
16+ await micropip.install(f"./{ WHEEL_FILENAME } ")
17+ import ifcopenshell
18+ ifc_file = ifcopenshell.file()
19+ wall = ifc_file.create_entity("IfcWall")
20+ wall1 = ifc_file.by_type("IfcWall")[0]
21+ print(wall, wall1)
22+ assert wall == wall1, "Wall entity doesn't match"
23+ wall.Name = "Test"
24+ assert wall.Name == "Test", f"Entity name wasn't changed: {{wall}}"
25+ print(wall)
26+ """
27+ )
You can’t perform that action at this time.
0 commit comments