Previously the make commands for Jupyter, Mkdocs, and Pytest, were dependent on the project, i.e. every time you executed make docs, the full setup was run:
docs: project
.venv/bin/mkdocs serve
On the one hand this was good, because it made sure that the requirements are up to date before executing the command.
On the other hand, this was very time consuming, so I decided to remove this dependency. So now, the command is much faster, because it assumes that the project was setup correctly and does not check on requirements:
docs:
.venv/bin/mkdocs serve
However, I want to make it more evident that the user needs to execute make before this command can be executed. So ideally, if the dependency is not fulfilled, the user should get a message on the console to execute make.
This could be as simple as
docs:
.venv/bin/mkdocs serve || echo "You need to execute 'make' first"
However, this would mean to repeat the or clause || in all mentioned commands.
So the plan is to avoid repetition and implement the following approach, which is the scope of this issue:
# General check for any tool in .venv/bin
check-tool:
@if [ ! -f .venv/bin/$(tool) ]; then \
echo "You need to execute 'make' first to install dependencies"; \
exit 1; \
fi
# Target to run Jupyter notebook
jupyter: tool=jupyter
jupyter: check-tool
.venv/bin/jupyter notebook --no-browser
It should work for every command below the jupyter command. You can search for TODO issue-135 in the code. Dependent on #134 .
Previously the
make
commands for Jupyter, Mkdocs, and Pytest, were dependent on theproject
, i.e. every time you executedmake docs
, the full setup was run:On the one hand this was good, because it made sure that the requirements are up to date before executing the command.
On the other hand, this was very time consuming, so I decided to remove this dependency. So now, the command is much faster, because it assumes that the project was setup correctly and does not check on requirements:
However, I want to make it more evident that the user needs to execute
make
before this command can be executed. So ideally, if the dependency is not fulfilled, the user should get a message on the console to executemake
.This could be as simple as
However, this would mean to repeat the or clause
||
in all mentioned commands.So the plan is to avoid repetition and implement the following approach, which is the scope of this issue:
It should work for every command below the
jupyter
command. You can search forTODO issue-135
in the code. Dependent on #134 .