-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (57 loc) · 1.34 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
70
71
72
73
# = Makefile
#
# Automate some regular actions
#
#
.PHONY: test build upload clean
.ONESHELL:
SHELL := /bin/bash
all:
@echo " init-env"
@echo " Use like 'eval $$(make init-env)'"
@echo " lint"
@echo " Check style with flake8."
@echo " test"
@echo " Run pytest"
@echo " build"
@echo " Build packages"
@echo " upload"
@echo " Upload the packages to Pypi"
@echo " clean-pyc"
@echo " Remove python artifacts."
@echo " clean-build"
@echo " Remove build artifacts."
# Helpers
init-env:
@echo "export PATH=$$(pwd)/tools/bin:${PATH}"
# Tests
lint:
export PATH=$$(pwd)/tools/bin:${PATH} \
&& cd src/ \
&& flake8
test: clean-pyc
cd src/ \
&& python setup.py test
# Actions
build:
cp README.md src/ \
&& cd src/ \
&& python setup.py sdist \
&& rm README.md
upload:
export PATH=$$(pwd)/tools/bin:${PATH} \
&& twine upload --repository testpypi src/dist/*
# Clean
clean-build:
cd src/
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
clean-tests:
git checkout -- tests/docker-compose/puppetserver
rm -rf tests/docker-compose/puppetca_cli/
clean-pyc:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
clean: clean-pyc clean-build clean-tests