-
Notifications
You must be signed in to change notification settings - Fork 25
/
makefile.mk
148 lines (119 loc) · 4.02 KB
/
makefile.mk
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
UNAME=$(shell uname)
VERSION=`head -1 VERSION`
COMMAND := $(subst cloudmesh-,,$(package))
define banner
@echo
@echo "############################################################"
@echo "# $(1) "
@echo "############################################################"
endef
.PHONY: dist
welcome: ## Display welcome message
$(call banner, "Install ${package}")
source: welcome ## Install the package in source mode
pip install -e .
pip: welcome ## Install the package in pip mode
pip install -e . --config-settings editable_mode=strict
readme:
cms man readme -p --command=${COMMAND}
##############################################################################
# CHECK
##############################################################################
flake8: ## Run flake8
cd ..; flake8 --max-line-length 124 --ignore=E722 $(package)/src/cloudmesh
cd ..; flake8 --max-line-length 124 --ignore=E722 $(package)/tests
pylint: ## Run pylint
cd ..; pylint --rcfile=$(package)/.pylintrc $(package)/src/cloudmesh
cd ..; pylint --rcfile=$(package)/.pylintrc --disable=F0010 $(package)/tests
##############################################################################
# CLEAN
##############################################################################
clean: ## Clean the project
$(call banner, "CLEAN")
rm -rf *.egg-info
rm -rf *.eggs
rm -rf docs/build
rm -rf build
rm -rf dist
rm -rf .tox
rm -rf .tmp
find . -type d -name '__pycache__' -exec rm -rf {} +
pip uninstall ${package} -y
cleanall: ## Clean all the project
cd ../cloudmesh-common; make clean
cd ../cloudmesh-cmd5; make clean
cd ../cloudmesh-sys; make clean
cd ../cloudmesh-bar; make clean
cd ../cloudmesh-bumpversion; make clean
cd ../cloudmesh-vpn; make clean
cd ../cloudmesh-gpu; make clean
cd ../cloudmesh-rivanna; make clean
cd ../cloudmesh-catalog; make clean
##############################################################################
# INFO
##############################################################################
info: ## Display info about the project
@echo "================================================="
@git remote show origin
@echo "================================================="
@git shortlog -sne --all
@echo "================================================="
##############################################################################
# TEST
##############################################################################
test: ## Run tests
pytest -v --html=.report.html
open .report.html
dtest: ## Run tests with no capture
pytest -v --capture=no
######################################################################
# PYPI
######################################################################
twine: ## Install twine
pip install -U twine
dist: ## Build the package
pip install -q build
python -m build
twine check dist/*
local: welcome twine dist ## Install the package locally
pip install dist/*.whl
local-force: welcome twine ## Install the package locally with force
pip install dist/*.whl --force-reinstall
patch: twine ## Build the package and upload it to testpypi
$(call banner, "patch")
pip install -r requirements-dev.txt
bumpversion patch
@VERSION=$$(cat VERSION); \
git commit -m "bump version ${VERSION}" .; git push
pip install -q build
python -m build
twine check dist/*
twine upload --repository testpypi dist/*
minor: ## increase the minor version number
$(call banner, "minor")
bumpversion minor
@cat VERSION
@echo
major: ## increase the major version number
$(call banner, "major")
bumpversion major
@cat VERSION
@echo
release: ## create a release
$(call banner, "release")
git tag "v$(VERSION)"
git push origin main --tags
pip install -q build
python -m build
twine upload --repository pypi dist/*
$(call banner, "install")
@cat VERSION
@echo
upload: ## Upload the package to pypi
twine check dist/*
twine upload dist/*
log: ## Update the ChangeLog
$(call banner, log)
gitchangelog | fgrep -v ":dev:" | fgrep -v ":new:" > ChangeLog
git commit -m "chg: dev: Update ChangeLog" ChangeLog
git push