This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
80 lines (57 loc) · 1.36 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
# Global parameters
SHELL := /bin/bash
PYPATH := /usr/bin/python3
PYEXE := $(PWD)/venv/bin/python
PGKNAME := randtest
# Main
.PHONY: all help program
all: program
help: Makefile
@sed -n 's/^##//p' $<
program:
@echo "Commands for package management"
@echo "make help"
## venv :: Create virtual Python enviroment
.PHONY: venv
venv:
$(PYPATH) -m venv $(PWD)/venv
## rmvenv :: Remove venv/ directory
.PHONY: rmvenv
rmvenv:
rm -rf venv/
## install :: Install package
.PHONY: install
install:
$(PYEXE) -m pip install .
## develop :: Install development package
.PHONY: develop
develop:
$(PYEXE) -m pip install -e .
## uninstall :: Uninstall (development) package
.PHONY: uninstall
uninstall:
$(PYEXE) -m pip uninstall --yes $(PGKNAME)
## dev-uninstall :: Uninstall (development) package
.PHONY: dev-uninstall
dev-uninstall:
$(PYEXE) -m pip uninstall --yes $(PGKNAME)
rm -r $(PGKNAME).egg-info
## example-smart-drug :: Run the smart drug example
.PHONY: example-smart-drug
example-smart-drug:
$(PYEXE) examples/smart_drug.py
## tests :: Run tests
.PHONY: tests
tests:
cd tests/ && make tests && cd -
## rmdir :: Remove __pychache__ directories
.PHONY: rmdir
rmdir:
find . -name __pycache__ -type d -exec rm -rf {} +
## vars :: Echo variables
.PHONY: vars
vars:
@echo SHELL: $(SHELL)
@echo PYPATH: $(PYPATH)
@echo PYEXE: $(PYEXE)
@echo PGKNAME: $(PGKNAME)