-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (70 loc) · 4.69 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
74
75
76
77
78
79
80
81
82
83
###########
# Helpers #
###########
# Thanks to Francoise at marmelab.com for this
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
print-%:
@echo '$*=$($*)'
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
SED = sed -i
endif
ifeq ($(UNAME), Darwin)
SED = sed -i '' -e
endif
.PHONY: gen-python gen-cpp gen-js gen-jupyter gen-rust
gen-python: ## regenerate the python template from scratch
mkdir -p ../python-template && cd ../python-template && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
copier copy -w . ../python-template --data-file examples/python.yml
cd ../python-template && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
gen-cpp: ## regenerate the c++ template from scratch
mkdir -p ../python-template-cpp && cd ../python-template-cpp && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
copier copy -w . ../python-template-cpp --data-file examples/cpp.yml
cd ../python-template-cpp && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
gen-js: ## regenerate the js template from scratch
mkdir -p ../python-template-js && cd ../python-template-js && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
copier copy -w . ../python-template-js --data-file examples/js.yml
cd ../python-template-js && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
gen-jupyter: ## regenerate the jupyter template from scratch
mkdir -p ../python-template-jupyter && cd ../python-template-jupyter && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
copier copy -w . ../python-template-jupyter --data-file examples/jupyter.yml
cd ../python-template-jupyter && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
gen-rust: ## regenerate the rust template from scratch
mkdir -p ../python-template-rust && cd ../python-template-rust && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
copier copy -w . ../python-template-rust --data-file examples/rust.yml
cd ../python-template-rust && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
.PHONY: test-python test-cpp test-js test-jupyter test-rust
test-python:
cd ../python-template && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@[email protected]" && git init && git add . && git commit -m "initial commit"
cd ../python-template && make develop
cd ../python-template && make lint
cd ../python-template && make checks
cd ../python-template && make test
test-cpp:
cd ../python-template-cpp && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@[email protected]" && git init && git add . && git commit -m "initial commit"
cd ../python-template-cpp && git init && git add . && git commit -m "initial commit"
cd ../python-template-cpp && make develop
cd ../python-template-cpp && make lint
cd ../python-template-cpp && make checks
cd ../python-template-cpp && make test
test-js:
cd ../python-template-js && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@[email protected]" && git init && git add . && git commit -m "initial commit"
cd ../python-template-js && make develop
cd ../python-template-js && make lint
cd ../python-template-js && make checks
cd ../python-template-js && make test
test-jupyter:
cd ../python-template-jupyter && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@[email protected]" && git init && git add . && git commit -m "initial commit"
cd ../python-template-jupyter && make develop
cd ../python-template-jupyter && make lint
cd ../python-template-jupyter && make checks
cd ../python-template-jupyter && make test
test-rust:
cd ../python-template-rust && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@[email protected]" && git init && git add . && git commit -m "initial commit"
cd ../python-template-rust && make develop
cd ../python-template-rust && git add Cargo.lock && git commit -m "lockfile"
cd ../python-template-rust && make lint
cd ../python-template-rust && make checks
cd ../python-template-rust && make test