Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check dependencies in Makefile #135

Closed
pkeilbach opened this issue Oct 7, 2024 · 1 comment · Fixed by #169
Closed

Check dependencies in Makefile #135

pkeilbach opened this issue Oct 7, 2024 · 1 comment · Fixed by #169
Labels
devops Related to the project setup and devops pipeline good first issue Good for newcomers 🏅 🏅 2 bonus points

Comments

@pkeilbach
Copy link
Owner

pkeilbach commented Oct 7, 2024

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 .

@pkeilbach pkeilbach added devops Related to the project setup and devops pipeline good first issue Good for newcomers labels Oct 7, 2024
@pkeilbach pkeilbach linked a pull request Nov 22, 2024 that will close this issue
@pkeilbach
Copy link
Owner Author

closed by #169

@pkeilbach pkeilbach reopened this Nov 22, 2024
@pkeilbach pkeilbach added this to the Winter term 2024/25 milestone Nov 25, 2024
@pkeilbach pkeilbach reopened this Dec 6, 2024
@pkeilbach pkeilbach added 🏅 🏅 2 bonus points and removed 🏅 🏅 2 bonus points labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Related to the project setup and devops pipeline good first issue Good for newcomers 🏅 🏅 2 bonus points
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant