-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (40 loc) · 1.4 KB
/
Copy pathMakefile
File metadata and controls
47 lines (40 loc) · 1.4 KB
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
# Copyright (c) 2020 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the COPYING file.
PCOMP = python3 -m grpc_tools.protoc # ensure we're using python's version and not some sys
PROTO_DIRS = cloudvision/compliance cloudvision/Connector
BUILD_ARTIFACTS := cloudvision.egg-info build dist _build docsrc/arista*.rst \
docsrc/cloudvision*.rst docsrc/fmp*.rst .pytest_cache
.PHONY: clean lint dist dev-setup docs proto
# re-generate python protobuf files
proto:
@for dir in $(PROTO_DIRS); do \
aristaproto_out=""; \
if [ "$$dir" = "cloudvision/compliance" ]; then \
mkdir -p $$dir/async; \
aristaproto_out="--python_aristaproto_out=$$dir/async"; \
fi; \
$(PCOMP) -I=$$dir/protobuf --python_out=$$dir/gen \
--mypy_out=$$dir/gen --grpc_python_out=$$dir/gen \
$$aristaproto_out \
$$dir/protobuf/*.proto || exit; \
python3 scripts/fix_proto_imports.py $$dir/gen || exit; \
done
# clean all stuff related to dist-ing these packages
clean:
@for artifact in ${BUILD_ARTIFACTS} ; do \
rm -r $$artifact && echo "$$artifact removed" ; \
done || exit 0
dist: clean
python3 -m build
dev-setup:
pip3 install .[dev]
lint:
flake8 .
mypy --namespace-packages --exclude build --exclude .venv .
./check_copyright.sh
docs:
sphinx-apidoc -o docsrc arista
sphinx-apidoc -o docsrc cloudvision
sphinx-apidoc -o docsrc fmp
sphinx-build docsrc _build