forked from gabrielfalcao/HTTPretty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (51 loc) · 1.38 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
69
# Config
OSNAME := $(shell uname)
ifeq ($(OSNAME), Linux)
OPEN_COMMAND := gnome-open
else
OPEN_COMMAND := open
endif
all: lint unit functional docs
export PYTHONPATH := ${PWD}
export PYTHONASYNCIODEBUG :=1
dependencies:
@pip install -U pip
@pip install pipenv
@pipenv install --dev --skip-lock
test: lint unit functional pyopenssl
lint: prepare
@echo "Checking code style ..."
@pipenv run flake8 --show-source httpretty tests
unit: prepare
@echo "Running unit tests ..."
@pipenv run nosetests --cover-erase tests/$@
functional: prepare
@echo "Running functional tests ..."
@pipenv run nosetests --cover-erase tests/$@
pyopenssl: prepare
@echo "Running PyOpenSSL mocking tests ..."
@pipenv install --skip-lock ndg-httpsclient
@pipenv run nosetests --rednose -x --with-coverage --cover-package=httpretty -s tests/pyopenssl
clean:
@printf "Cleaning up files that are already in .gitignore... "
@for pattern in `cat .gitignore`; do rm -rf $$pattern; done
@echo "OK!"
@printf "Deleting built documentation"
@rm -rf docs/build
@printf "Deleting dist files"
@rm -rf dist
release: lint unit functional docs
@rm -rf dist/*
@make rogue-release
rogue-release:
@./.release
@make pypi
pypi:
@pipenv run python setup.py build sdist
@pipenv run twine upload dist/*.tar.gz
docs:
@cd docs && make html
$(OPEN_COMMAND) docs/build/html/index.html
prepare:
@reset
.PHONY: docs