Skip to content

Commit

Permalink
Revamp Makefile
Browse files Browse the repository at this point in the history
- Install build package in venv
- Loosen JupyterLab version constraint
- Add recipe for wheel file
  • Loading branch information
xofbd committed Mar 21, 2024
1 parent b7cb243 commit 0885885
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
SHELL := /bin/bash
VENV := venv
ACTIVATE_VENV := source $(VENV)/bin/activate
VERSION := $(shell jq -r .version package.json)

.PHONY: all
all: clean build launch
all: clean build-dev launch

$(VENV)/bin/activate:
python3 -m venv $(VENV)
$(ACTIVATE_VENV) && pip install jupyterlab==4.0.0
$(ACTIVATE_VENV) && pip install 'jupyterlab>=4.0.0,<5'
$(ACTIVATE_VENV) && pip install build==1.1.1

.PHONY: build
build: $(VENV)/bin/activate
.PHONY: build-dev
build-dev: $(VENV)/bin/activate
$(ACTIVATE_VENV) && pip install -e .
$(ACTIVATE_VENV) && jupyter labextension develop . --overwrite
$(ACTIVATE_VENV) && jupyter server extension enable jupyterlab_custom_order
$(ACTIVATE_VENV) && jlpm build

.PHONY: build-wheel
build-wheel: dist/jupyterlab_custom_order-$(VERSION)-py3-none-any.whl

dist/jupyterlab_custom_order-$(VERSION)-py3-none-any.whl: $(VENV)/bin/activate
$(ACTIVATE_VENV) && python3 -m build

.PHONY: launch
launch:
$(ACTIVATE_VENV) && jupyter-lab
Expand Down

0 comments on commit 0885885

Please sign in to comment.