File: Makefile

package info (click to toggle)
python-scrapli 2023.7.30-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,536 kB
  • sloc: python: 14,459; makefile: 72
file content (79 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.DEFAULT_GOAL := help

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

lint:  ## Run linters
	python -m isort .
	python -m black .
	python -m pylama .
	python -m pydocstyle .
	python -m mypy --strict scrapli/

darglint:  ## Run darglint (docstring/arg checker)
	find scrapli -type f \( -iname "*.py" \) | xargs darglint -x

test:  ## Run all tests
	python -m pytest \
	tests/

cov:  ## Run all tests with term and html coverage report
	python -m pytest \
	--cov=scrapli \
	--cov-report html \
	--cov-report term \
	tests/

test_unit:  ## Run all unit tests
	python -m pytest \
	tests/unit/

cov_unit:  ## Run all unit tests with term and html coverage report
	python -m pytest \
	--cov=scrapli \
	--cov-report html \
	--cov-report term \
	tests/unit/

test_integration:  ## Run integration tests
	python -m pytest \
	tests/integration/

cov_integration:  ## Run integration with term and html coverage report
	python -m pytest \
	--cov=scrapli \
	--cov-report html \
	--cov-report term \
	tests/integration/

test_functional:  ## Run functional tests
	python -m pytest \
	tests/functional/

cov_functional:  ## Run functional tests with term and html coverage report
	python -m pytest \
	--cov=scrapli \
	--cov-report html \
	--cov-report term \
	tests/functional/

.PHONY: docs
docs:  ## Regenerate docs
	python docs/generate.py

test_docs:  ## Run doc testing
	mkdocs build --clean --strict
	htmltest -c docs/htmltest.yml -s
	rm -rf tmp

deploy_docs:  ## Deploy docs to github
	mkdocs gh-deploy

deploy_clab: ## Deploy functional clab test topology
	cd .clab && sudo clab deploy -t topo-full.yaml

destroy_clab: ## Destroy functional clab test topology
	cd .clab && sudo clab destroy -t topo-full.yaml

prepare_dev_env: ## Prepare a running clab environment with base configs for testing
	python tests/prepare_devices.py cisco_iosxe,cisco_nxos,cisco_iosxr,arista_eos,juniper_junos