Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
install jupyter
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchobben committed Jul 17, 2024
1 parent aa4664a commit ad22c34
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ YML = $(wildcard chapters/*.yml)
REQ = $(basename $(notdir $(YML)))
CONDA_ENV_DIR := $(foreach i,$(REQ),$(shell conda info --base)/envs/$(i))
KERNEL_DIR := $(foreach i,$(REQ),$(shell jupyter --data-dir)/kernels/$(i))
CONDA_ACTIVATE_BASE = source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate
CONDA_ACTIVATE = $(CONDA_ACTIVATE_BASE) ; conda activate
CONDA_ACTIVATE = source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate

help:
@echo "make clean"
Expand All @@ -18,21 +17,19 @@ help:

clean:
rm --force --recursive .ipynb_checkpoints/
conda deactivate
for i in $(REQ); do conda remove -n $$i --all -y ; jupyter kernelspec uninstall -y $$i ; done

$(CONDA_ENV_DIR):
for i in $(YML); do conda env create -f $$i && pip install update pip setuptools wheel ; done
for i in $(YML); do conda env create -f $$i ; $(CONDA_ACTIVATE) $$i ; pip install --upgrade pip setuptools wheel ; done

environment: $(CONDA_ENV_DIR)
@echo -e "conda environments are ready."

$(KERNEL_DIR):
$(CONDA_ACTIVATE_BASE)
conda install jupyter -y
$(KERNEL_DIR): $(CONDA_ENV_DIR)
pip install jupyter
for i in $(REQ); do $(CONDA_ACTIVATE) $$i ; python -m ipykernel install --user --name $$i --display-name $$i ; conda deactivate; done

kernel: $(KERNEL_DIR) $(CONDA_ENV_DIR)
kernel: $(KERNEL_DIR)
@echo -e "conda jupyter kernel is ready."

post-render:
Expand Down

0 comments on commit ad22c34

Please sign in to comment.