Skip to content

Commit

Permalink
build and include webview client code in conda-packed output
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaranville committed Apr 26, 2024
1 parent bf190b4 commit 735a4a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion extra/build_conda_packed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ conda activate base || { echo 'failed: conda not installed'; exit 1; }

conda install -y conda-pack
conda remove -n "$ENV_NAME" -y --all
conda create -n "$ENV_NAME" -q --force -y "python=$PYTHON_VERSION"
conda create -n "$ENV_NAME" -q --force -y "python=$PYTHON_VERSION" "nodejs"
conda-pack -n "$ENV_NAME" -f -o "$ENV_NAME.tar.gz"

# unpack the new environment, that contains only python + pip
Expand All @@ -31,6 +31,16 @@ $envdir/bin/python -m pip install --no-input --no-compile git+https://github.com
$envdir/bin/python -m pip install --no-input --no-compile git+https://github.com/reflectometry/refl1d@webview
$envdir/bin/python -m pip install --no-compile -r https://raw.githubusercontent.com/bumps/bumps/webview/webview-requirements

# build the client
cd $envdir/lib/python$PYTHON_VERSION/site-packages/bumps/webview/client
$envdir/bin/npm install
$envdir/bin/npm link

cd $envdir/lib/python$PYTHON_VERSION/site-packages/refl1d/webview/client
$envdir/bin/npm link ../../../bumps/webview/client
$envdir/bin/npm install
$envdir/bin/npm run build

version=$($envdir/bin/python -c "import refl1d; print(refl1d.__version__)")
mv "$tmpdir/$DIRNAME" "$tmpdir/$DIRNAME-$version"

Expand Down
2 changes: 1 addition & 1 deletion refl1d/webview/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"json-difference": "^1.8.2",
"mpld3": "^0.5.8",
"plotly.js": "^2.29.0",
"pyodide": "^0.23.2",
"socket.io-client": "^4.5.2",
"uuid": "^9.0.0",
"vue": "^3.2.38",
"vue-json-viewer": "^3.0.4"
},
"devDependencies": {
"pyodide": "^0.23.2",
"@types/plotly.js": "^2.12.5",
"@types/uuid": "^8.3.4",
"@vitejs/plugin-vue": "^5.0.4",
Expand Down

0 comments on commit 735a4a3

Please sign in to comment.