-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
57 lines (41 loc) · 1.27 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
PKG := swagger_marshmallow_codegen
SHELL := bash
test:
pytest -vv $(PKG)
lint:
flake8 ${PKG} --ignore=E501,E303,E203,W391,W503
format:
black ${PKG} --exclude=dst
# TODO: typing
typing:
:
define runT
$(1)
endef
define findCandidatesT
$(shell find ${1} -mindepth 2 -name Makefile | xargs -n 1 -I{} dirname {} | sort)
endef
WHERE ?= ./examples
examples:
python -m pip install bson
$(foreach x,$(call findCandidatesT,$(WHERE)),$(call runT,OPTS=--logging=WARNING make --silent -C $(x)))
.PHONY: examples
# for travis
ci:
$(foreach x,$(call findCandidatesT,$(WHERE)),$(call runT,OPTS=--logging=WARNING make --silent -C $(x)))
test -z `git diff examples/` || (echo "*********DIFF*********" && git diff examples/ && exit 2)
.PHONY: ci
_find-candidates:
echo $(call findCandidatesT,$(WHERE))
#### for pypi ########################
get-version:
python -c 'import swagger_marshmallow_codegen as m; print(m.__version__)'
build:
# pip install wheel
python setup.py sdist bdist_wheel
upload:
# pip install twine keyrings.alt
twine check dist/swagger-marshmallow-codegen-$(shell make -s get-version)*
twine upload dist/swagger*marshmallow*codegen-$(shell make -s get-version)*.gz
twine upload dist/swagger*marshmallow*codegen*$(shell make -s get-version)*.whl
.PHONY: build upload