Renamed macros in Makefile

* `s/VENV/venv_full/; s/VENV_MIN/venv_min/; s/VENV_DEV/venv_dev/;`
* useful in subsequent changes

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
pull/2917/head
Ariel Otilibili 2024-08-11 17:40:27 +02:00
parent 7f049669fb
commit feac10a84d
1 changed files with 20 additions and 20 deletions

View File

@ -1,10 +1,10 @@
PORT ?= 8008 PORT ?= 8008
VENV := venv/bin venv_full:= venv/bin
VENV_DEV := venv-dev/bin venv_dev := venv-dev/bin
VENV_MIN := venv-min/bin venv_min := venv-min/bin
CONF := conf/glances.conf CONF := conf/glances.conf
PIP := $(VENV)/pip PIP := $(venv_full)/pip
PYTHON := $(VENV)/python PYTHON := $(venv_full)/python
LASTTAG = $(shell git describe --tags --abbrev=0) LASTTAG = $(shell git describe --tags --abbrev=0)
IMAGES_TYPES := full minimal dev IMAGES_TYPES := full minimal dev
@ -101,32 +101,32 @@ test: $(UNIT_TESTS) ## Run unit tests
test-with-upgrade: venv-upgrade venv-dev-upgrade test ## Upgrade deps and run unit tests test-with-upgrade: venv-upgrade venv-dev-upgrade test ## Upgrade deps and run unit tests
test-min: ## Run core unit tests in minimal environment test-min: ## Run core unit tests in minimal environment
$(VENV_MIN)/python unittest-core.py $(venv_min)/python unittest-core.py
test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in minimal environment test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in minimal environment
$(VENV_MIN)/python unittest-core.py $(venv_min)/python unittest-core.py
# =================================================================== # ===================================================================
# Linters, profilers and cyber security # Linters, profilers and cyber security
# =================================================================== # ===================================================================
format: ## Format the code format: ## Format the code
$(VENV_DEV)/python -m ruff format . $(venv_dev)/python -m ruff format .
lint: ## Lint the code. lint: ## Lint the code.
$(VENV_DEV)/python -m ruff check . --fix $(venv_dev)/python -m ruff check . --fix
codespell: ## Run codespell to fix common misspellings in text files codespell: ## Run codespell to fix common misspellings in text files
$(VENV_DEV)/codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics -w $(venv_dev)/codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics -w
semgrep: ## Run semgrep to find bugs and enforce code standards semgrep: ## Run semgrep to find bugs and enforce code standards
$(VENV_DEV)/semgrep scan --config=auto $(venv_dev)/semgrep scan --config=auto
profiling-gprof: ## Callgraph profiling (need "apt install graphviz") profiling-gprof: ## Callgraph profiling (need "apt install graphviz")
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)" @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3 sleep 3
$(PYTHON) -m cProfile -o ./glances.cprof ./run.py --stop-after 30 $(PYTHON) -m cProfile -o ./glances.cprof ./run.py --stop-after 30
$(VENV_DEV)/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg $(venv_dev)/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
rm -f ./glances.cprof rm -f ./glances.cprof
profiling-pyinstrument: ## PyInstrument profiling profiling-pyinstrument: ## PyInstrument profiling
@ -138,7 +138,7 @@ profiling-pyinstrument: ## PyInstrument profiling
profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12) profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12)
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)" @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3 sleep 3
$(VENV_DEV)/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- $(PYTHON) ./run.py --stop-after 30 $(venv_dev)/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- $(PYTHON) ./run.py --stop-after 30
profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software
@ -153,12 +153,12 @@ memory-profiling: ## Profile memory usage
@echo "It's a very long test (~4 hours)..." @echo "It's a very long test (~4 hours)..."
rm -f mprofile_*.dat rm -f mprofile_*.dat
@echo "1/2 - Start memory profiling with the history option enable" @echo "1/2 - Start memory profiling with the history option enable"
$(VENV_DEV)/mprof run -T 1 -C run.py -C $(CONF) --stop-after 2400 --quiet $(venv_dev)/mprof run -T 1 -C run.py -C $(CONF) --stop-after 2400 --quiet
$(VENV_DEV)/mprof plot --output ./docs/_static/glances-memory-profiling-with-history.png $(venv_dev)/mprof plot --output ./docs/_static/glances-memory-profiling-with-history.png
rm -f mprofile_*.dat rm -f mprofile_*.dat
@echo "2/2 - Start memory profiling with the history option disable" @echo "2/2 - Start memory profiling with the history option disable"
$(VENV_DEV)/mprof run -T 1 -C run.py -C $(CONF) --disable-history --stop-after 2400 --quiet $(venv_dev)/mprof run -T 1 -C run.py -C $(CONF) --disable-history --stop-after 2400 --quiet
$(VENV_DEV)/mprof plot --output ./docs/_static/glances-memory-profiling-without-history.png $(venv_dev)/mprof plot --output ./docs/_static/glances-memory-profiling-without-history.png
rm -f mprofile_*.dat rm -f mprofile_*.dat
# Trivy installation: https://aquasecurity.github.io/trivy/latest/getting-started/installation/ # Trivy installation: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
@ -256,13 +256,13 @@ run-local-conf-hide-public: ## Start Glances in console mode with the system con
$(PYTHON) -m glances --hide-public-info $(PYTHON) -m glances --hide-public-info
run-min: ## Start minimal Glances in console mode (also called standalone) run-min: ## Start minimal Glances in console mode (also called standalone)
$(VENV_MIN)/python -m glances -C $(CONF) $(venv_min)/python -m glances -C $(CONF)
run-min-debug: ## Start minimal Glances in debug console mode (also called standalone) run-min-debug: ## Start minimal Glances in debug console mode (also called standalone)
$(VENV_MIN)/python -m glances -C $(CONF) -d $(venv_min)/python -m glances -C $(CONF) -d
run-min-local-conf: ## Start minimal Glances in console mode with the system conf file run-min-local-conf: ## Start minimal Glances in console mode with the system conf file
$(VENV_MIN)/python -m glances $(venv_min)/python -m glances
$(DOCKER_RUNTIMES): run-docker-%: $(DOCKER_RUNTIMES): run-docker-%:
$(DOCKER_RUN) $(DOCKER_OPTS) $(DOCKER_SOCKS) -it glances:local-$* $(DOCKER_RUN) $(DOCKER_OPTS) $(DOCKER_SOCKS) -it glances:local-$*