forked from TrueCloudLab/frostfs-testlib
49 lines
No EOL
1.4 KiB
Makefile
49 lines
No EOL
1.4 KiB
Makefile
SHELL := /bin/bash
|
|
PYTHON_VERSION := 3.10
|
|
VENV_DIR := venv.frostfs-testlib
|
|
|
|
current_dir := $(shell pwd)
|
|
DIRECTORIES := $(sort $(dir $(wildcard ../frostfs-testlib-plugin-*/ ../*-testcases/)))
|
|
FROM_VENV := . ${VENV_DIR}/bin/activate &&
|
|
|
|
venv: create requirements paths precommit
|
|
@echo Ready
|
|
|
|
precommit:
|
|
@echo Isntalling pre-commit hooks
|
|
. ${VENV_DIR}/bin/activate && pre-commit install
|
|
|
|
paths:
|
|
@echo Append paths for project
|
|
@echo Virtual environment: ${VENV_DIR}
|
|
@rm -rf ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
|
@touch ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
|
@echo ${current_dir}/src/frostfs_testlib_frostfs_testlib | tee ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
|
|
|
create: ${VENV_DIR}
|
|
|
|
${VENV_DIR}:
|
|
@echo Create virtual environment ${VENV_DIR}
|
|
virtualenv --python=python${PYTHON_VERSION} --prompt=frostfs-testlib ${VENV_DIR}
|
|
|
|
requirements:
|
|
@echo Isntalling pip requirements
|
|
. ${VENV_DIR}/bin/activate && pip install -Ur requirements.txt
|
|
|
|
|
|
#### VALIDATION SECTION ####
|
|
lint: create requirements
|
|
${FROM_VENV} pylint --disable R,C,W ./src
|
|
|
|
unit_test:
|
|
@echo Starting unit tests
|
|
${FROM_VENV} python -m pytest tests
|
|
|
|
.PHONY: lint_dependent $(DIRECTORIES)
|
|
lint_dependent: $(DIRECTORIES)
|
|
|
|
$(DIRECTORIES):
|
|
@echo checking dependent repo $@
|
|
$(MAKE) validation -C $@
|
|
|
|
validation: lint unit_test lint_dependent |