-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (48 loc) · 1.32 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
# REF:
# master : refs/heads/master"
# beta : refs/heads/beta/0.3.7
# release : refs/tags/release/0.3.7
REF=$(shell git rev-parse --symbolic-full-name HEAD)
SHA=$(shell git rev-parse HEAD)
RUNNO=123
RUNID=5753082134
GITHUB_DUMP="{\"ref\": $(REF), \"sha\": $(SHA), \"run_id\": $(RUNID), \"run_number\": $(RUNNO)}"
export GITHUB_DUMP
help:
@echo "make help|tests|build"
@echo ""
@echo "Vars"
@echo " REF: $(REF)"
@echo " SHA: $(SHA)"
@echo " RUNID: $(RUNID)"
@echo " RUNNO: $(RUNNO)"
@echo " GITHUB_DUMP: $(GITHUB_DUMP)"
tests:
py.test -vvs tests
.PHONY: build
build:
rm -rf dist
git checkout src/setuptools_github/__init__.py
GITHUB_DUMP='\
{\
"ref": "$(REF)", \
"sha": "$(SHA)", \
"run_number": $(RUNNO), \
"run_id": $(RUNID) \
}\
' python -m build $(NFLAG)
branch:
rm -rf dist src/setuptools_github/_build.py
git checkout src/setuptools_github/__init__.py
GITHUB_DUMP='\
{\
"ref": "refs/heads/$(shell git branch --show-current)", \
"sha": "$(shell git rev-parse HEAD)", \
"run_number": 92, \
"run_id": 5767031699 \
}\
' python -m build
clean:
-git checkout src/setuptools_github/__init__.py README.md
rm -rf dist setuptools_github.egg-info src/setuptools_github/_build.py
.PHONY: tests branch