-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: makefile to install first pre-commit and then venv, documentation
in README.md Signed-off-by: R.A. te Boekhorst <[email protected]>
- Loading branch information
1 parent
14541a6
commit be90a2e
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
COLOUR_GREEN=\033[0;32m | ||
COLOUR_RED=\033[0;31m | ||
COLOUR_BLUE=\033[0;34m | ||
COLOUR_END=\033[0m | ||
|
||
.DEFAULT_GOAL:=help | ||
|
||
SHELL := /bin/bash | ||
GENERAL_LIB_LOCATION := $(shell pip show rados | grep -oP "(?<=Location: ).*") | ||
LIBRADOS_LOCATION := $(shell find "${GENERAL_LIB_LOCATION}" -name 'rados*.so' -print) | ||
LIBRADOS_EGGINFO_LOCATION := $(shell find "${GENERAL_LIB_LOCATION}" -name 'rados*.egg-info' -print) | ||
LIBRADOS_NAME := $(shell basename "${LIBRADOS_LOCATION}") | ||
LIBRADOS_EGGINFO_NAME := $(shell basename "${LIBRADOS_EGGINFO_LOCATION}") | ||
|
||
.PHONY: help | ||
help: ## Display this help message | ||
@echo -e '${COLOUR_RED}Usage: make <command>${COLOUR_END}' | ||
@cat $(MAKEFILE_LIST) | grep '^[a-zA-Z]' | \ | ||
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n\n", $$1, "${COLOUR_GREEN}"$$2"${COLOUR_END}"}' | ||
|
||
.PHONY: setup | ||
setup: ## Setting up the pre-commit environment and then the venv environment | ||
${MAKE} setup-pre-commit && \ | ||
${MAKE} setup-venv | ||
|
||
setup-pre-commit: | ||
pip install --user pre-commit && pre-commit install | ||
|
||
setup-venv: | ||
python -m venv ./.venv | ||
source ./.venv/bin/activate | ||
@echo -e 'GENERAL_LIB_LOCATION: ${GENERAL_LIB_LOCATION}' | ||
@echo -e 'LIBRADOS_LOCATION: ${LIBRADOS_LOCATION}' | ||
@echo -e 'LIBRADOS_EGGINFO_LOCATION: ${LIBRADOS_EGGINFO_LOCATION}' && \ | ||
ln -s "${LIBRADOS_LOCATION}" ./.venv/lib/python3.12/site-packages/"${LIBRADOS_NAME}" && \ | ||
ln -s "${LIBRADOS_EGGINFO_LOCATION}" ./.venv/lib/python3.12/site-packages/"${LIBRADOS_EGGINFO_NAME}" && \ | ||
pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters