2020-09-24 02:12:27 +03:00
|
|
|
# This Makefile simply automates all our tasks. Its use is optional.
|
|
|
|
|
2020-10-03 01:30:01 +03:00
|
|
|
all: setup run test check
|
2020-09-24 02:12:27 +03:00
|
|
|
|
|
|
|
# Install Python packages
|
|
|
|
setup:
|
2022-05-27 02:52:30 +03:00
|
|
|
@poetry install --no-ansi --remove-untracked -E "azure libvirt doc legacy aws"
|
2020-09-24 02:12:27 +03:00
|
|
|
|
2021-03-23 15:17:31 +03:00
|
|
|
# Run LISA
|
2020-09-24 02:12:27 +03:00
|
|
|
run:
|
2020-10-01 04:21:25 +03:00
|
|
|
@poetry run python -X dev lisa/main.py --debug
|
2020-09-24 02:12:27 +03:00
|
|
|
|
|
|
|
# Run unit tests
|
|
|
|
test:
|
2021-08-06 10:13:32 +03:00
|
|
|
@poetry run python -X dev -m unittest discover
|
2020-09-24 02:12:27 +03:00
|
|
|
|
2021-03-23 15:17:31 +03:00
|
|
|
# Generate coverage report (slow, reruns LISA and tests)
|
2020-09-24 02:12:27 +03:00
|
|
|
coverage:
|
|
|
|
@poetry run coverage erase
|
2021-08-06 10:13:32 +03:00
|
|
|
@poetry run coverage run lisa/main.py
|
|
|
|
@poetry run coverage run --append -m unittest discover
|
2021-05-14 11:10:31 +03:00
|
|
|
@poetry run coverage report --skip-empty --include=lisa*,examples*,microsoft/testsuites* --omit=lisa/tests/* --precision 2
|
2020-09-24 02:12:27 +03:00
|
|
|
|
|
|
|
# Run syntactic, semantic, formatting and type checkers
|
|
|
|
check: flake8 mypy
|
|
|
|
|
|
|
|
# This also runs Black and isort via plugins
|
|
|
|
flake8:
|
|
|
|
@poetry run flake8
|
|
|
|
|
|
|
|
# This runs the static type checking
|
|
|
|
mypy:
|
2021-09-02 07:06:12 +03:00
|
|
|
@poetry run mypy --strict --exclude '.venv/.*' --namespace-packages --implicit-reexport --config-file pyproject.toml -p docs -p lisa -p microsoft
|
2020-09-24 02:12:27 +03:00
|
|
|
|
|
|
|
# Print current Python virtualenv
|
|
|
|
venv:
|
|
|
|
@poetry env list --no-ansi --full-path
|
2022-01-10 21:35:41 +03:00
|
|
|
|
|
|
|
# Auto fix style issues.
|
|
|
|
fix: fix-isort fix-black
|
|
|
|
|
|
|
|
fix-isort:
|
|
|
|
@poetry run isort ./lisa ./microsoft
|
|
|
|
|
|
|
|
fix-black:
|
|
|
|
@poetry run black ./lisa ./microsoft
|