-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
56 lines (39 loc) · 937 Bytes
/
Makefile
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
# Default
.PHONY: all
# Build
.PHONY: build
# Test
.PHONY: test tests unit_tests
# Clean up
.PHONY: clean clean_build clean_tests
# Format code
.PHONY: fix lint
PYTHON ?= python
PIP ?= pip
YAPF ?= yapf
UNITTEST = $(PYTHON) -m unittest
all: build
build:
@python setup.py sdist bdist_wheel
fix:
@echo 'Auto-formatting code...'
-@$(YAPF) --in-place --recursive --verify MockSSH.py tests/ examples/
lint:
@echo 'Checking code format...'
@$(YAPF) --diff --recursive MockSSH.py tests/ examples/ || (st=$$?; echo 'Please run "make fix" to correct the formatting errors.'; exit $$st)
release: clean build upload_release
upload_release:
-@$(PIP) install twine
@twine upload dist/*
test: tests
tests: unit_tests clean_tests
unit_tests: build
$(UNITTEST) discover -s tests/
clean: clean_build clean_tests
clean_build:
@python setup.py clean
clean_tests:
$(call _clean_tests)
define _clean_tests
@rm -f tests/*.pyc
endef