-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (51 loc) · 2.47 KB
/
Copy pathMakefile
File metadata and controls
61 lines (51 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: install assets lite-ext lite-build lite-dev lite-test run
VENV = ./venv
# Override to use a different toolchain, e.g. a conda env already on PATH:
# make lite-build BIN=$(dirname $(which jupyter))
BIN ?= $(VENV)/bin
install:
python3 -m venv venv
${BIN}/pip install -U pip
${BIN}/pip install -e .
${BIN}/pip install -e .[services,hdf5,plugins,blosc2-plugins,lite]
${BIN}/pip install -e .[clients]
${BIN}/pip install -e .[tests]
${BIN}/pip install pre-commit
assets:
rm caterva2/services/static/build/*
npm run build
git add caterva2/services/static/build/
# Build the caterva2-save JupyterLite extension (needs Node + jlpm/JupyterLab).
# Commit the resulting jupyterlite-exts/caterva2-save/labextension/ so the
# caterva2 wheel ships it and downstream installs need no Node toolchain.
# `develop --overwrite` registers it for an *editable* caterva2 install (whose
# wheel shared-data is not staged into share/jupyter/labextensions/).
lite-ext:
cd jupyterlite-exts/caterva2-save && jlpm install && jlpm build:prod
# Register for an *editable* caterva2 install (whose wheel shared-data is not
# staged into share/jupyter/labextensions/); a real wheel install does this.
mkdir -p ${BIN}/../share/jupyter/labextensions
ln -sfn $(CURDIR)/jupyterlite-exts/caterva2-save/labextension ${BIN}/../share/jupyter/labextensions/caterva2-save
git add jupyterlite-exts/caterva2-save/labextension
lite-build:
rm -rf .jupyterlite.doit.db caterva2/services/static/jupyterlite
# --lite-dir points at the in-package jupyter-lite.json (contentsAllJsonFile),
# so the build picks it up regardless of the working directory (the deploy
# builds from elsewhere). See caterva2/services/lite-config/.
${BIN}/jupyter lite build --lite-dir caterva2/services/lite-config --output-dir caterva2/services/static/jupyterlite
# Installs our jupyterlite fork from a local copy, for development purposes
# Before doing this you must run "make build" in our jupyterlite fork
lite-dev:
${BIN}/pip uninstall jupyterlite jupyterlite-core -y
${BIN}/pip install ../jupyterlite/dist/jupyterlite_core-*.whl
${BIN}/pip install ../jupyterlite/dist/jupyterlite-*.whl
$(MAKE) lite-build
# Installs our jupyterlite fork from github, useful to test before deployment
lite-test:
rm downloads -rf
gh run -R ironArray/jupyterlite download -n "caterva2 dist" --dir downloads
${BIN}/pip install --force-reinstall downloads/*.whl
$(MAKE) lite-build
# To run the server, for convenience
run:
${BIN}/python3 -m caterva2.services.server