forked from TrueCloudLab/frostfs-testcases
Added code validation targets
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
f4a267fe81
commit
0ad2532e04
3 changed files with 25 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,7 +3,7 @@
|
|||
.idea
|
||||
|
||||
.DS_Store
|
||||
|
||||
venv.*
|
||||
venv_macos
|
||||
|
||||
|
||||
|
|
31
Makefile
31
Makefile
|
@ -4,26 +4,39 @@ VENV_NAME = frostfs-testcases-${PYTHON_VERSION}
|
|||
VENV_DIR := venv.${VENV_NAME}
|
||||
|
||||
current_dir := $(shell pwd)
|
||||
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
|
||||
${FROM_VENV} pre-commit install
|
||||
|
||||
paths:
|
||||
@echo Append paths for project
|
||||
@echo Virtual environment: ${VENV_DIR}
|
||||
@sudo rm -rf ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
||||
@sudo touch ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
||||
@echo ${current_dir} | sudo tee ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
||||
@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} | tee ${VENV_DIR}/lib/python${PYTHON_VERSION}/site-packages/_paths.pth
|
||||
|
||||
create:
|
||||
@echo Create virtual environment for
|
||||
virtualenv --python=python${PYTHON_VERSION} --prompt=${VENV_NAME} ${VENV_DIR}
|
||||
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 -e ../frostfs-testlib
|
||||
. ${VENV_DIR}/bin/activate && pip install -Ur pytest_tests/requirements.txt
|
||||
${FROM_VENV} pip install -e ../frostfs-testlib
|
||||
${FROM_VENV} pip install -Ur requirements.txt
|
||||
${FROM_VENV} pip install -Ur requirements_dev.txt
|
||||
|
||||
|
||||
#### VALIDATION SECTION ####
|
||||
lint: create requirements
|
||||
${FROM_VENV} pip install -e ../frostfs-testlib;
|
||||
${FROM_VENV} pylint --disable R,C,W pytest_tests
|
||||
|
||||
validation: lint
|
||||
${FROM_VENV} pytest --collect-only
|
|
@ -1,2 +1,3 @@
|
|||
pre-commit==2.20.0
|
||||
isort==5.12.0
|
||||
pylint==2.17.4
|
Loading…
Reference in a new issue