forked from madkote/fastapi-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
130 lines (103 loc) · 2.98 KB
/
Copy pathMakefile
File metadata and controls
130 lines (103 loc) · 2.98 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!make
.PHONY: clean-pyc clean-build
.DEFAULT_GOAL := help
SHELL = /bin/bash
help:
@echo ""
@echo " +---------------------------------------+"
@echo " | FastAPI Plugins |"
@echo " +---------------------------------------+"
@echo " clean"
@echo " Remove python and build artifacts"
@echo " install"
@echo " Install requirements for development and testing"
@echo " demo"
@echo " Run a simple demo"
@echo ""
@echo " test"
@echo " Run unit tests"
@echo " test-all"
@echo " Run integration tests"
@echo ""
clean-pyc:
@echo $@
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
clean-build:
@echo $@
rm --force --recursive .tox/
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
rm --force --recursive .pytest_cache/
clean-docker:
@echo $@
docker container prune -f
clean-pycache:
@echo $@
find . -name '__pycache__' -exec rm -rf {} +
clean: clean-build clean-docker clean-pyc clean-pycache
install: clean
@echo $@
pip install --no-cache-dir -U pip setuptools wheel
pip install --no-cache-dir -U -r requirements.txt
demo: clean
@echo $@
python demo.py
demo-app: clean
@echo $@
uvicorn scripts/demo_app:app
flake: clean
@echo $@
flake8 --statistics --ignore E252 fastapi_plugins tests scripts
bandit: clean
@echo $@
bandit -r fastapi_plugins/ tests/ scripts/ demo.py
test-unit-pytest:
@echo $@
time python -m pytest -v -x tests/ --cov=fastapi_plugins
test-unit: clean flake bandit docker-up-test test-unit-pytest docker-down-test
@echo $@
test-tox: clean
@echo $@
tox -vv
test: test-unit
@echo $@
test-all: test-unit test-tox
@echo $@
#md2rst:
# @echo $@
# m2r _README.md
# mv -f _README.rst README.rst
pypi-deps:
@echo $@
pip install -U twine
pypi-build: clean test-all pypi-deps
@echo $@
python setup.py sdist bdist_wheel
twine check dist/*
pypi-upload-test: pypi-deps
@echo $@
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pypi-upload: pypi-deps
@echo $@
python -m twine upload dist/*
docker-build-dev:
@echo $@
docker-compose -f docker-compose.memcached.yml -f docker-compose.sentinel.yml build
docker-up: clean-docker
@echo $@
docker-compose build --force-rm --no-cache --pull && docker-compose -f docker-compose.yml -f docker-compose.redis.yml -f docker-compose.memcached.yml up --build
# docker-compose -f docker-compose.yml -f docker-compose.redis.yml -f docker-compose.memcached.yml up --build --force-rm --no-cache --pull
docker-up-dev: clean-docker docker-build-dev
@echo $@
docker-compose -f docker-compose.memcached.yml -f docker-compose.sentinel.yml up
docker-up-test: clean-docker docker-build-dev
@echo $@
docker-compose -f docker-compose.memcached.yml -f docker-compose.sentinel.yml up -d
sleep 5
docker ps
docker-down-test:
@echo $@
docker-compose -f docker-compose.memcached.yml -f docker-compose.sentinel.yml down