forked from sunlabuiuc/PyHealth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
150 lines (118 loc) · 3.09 KB
/
makefile
File metadata and controls
150 lines (118 loc) · 3.09 KB
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
149
150
#@meta {author: "Paul Landes"}
#@meta {desc: "PyHealth build automation", date: "2025-05-22"}
## Build
#
TARG_DIR ?= target
DIST_DIR ?= $(TARG_DIR)/dist
## Targets
#
$(DIST_DIR):
mkdir -p $(DIST_DIR)
# install the pixi program
.PHONY: installpixi
installpixi:
@echo "checking for pixi..."
@$(eval ex := $(shell which pixi > /dev/null 2>&1 ; echo $$?))
@if [ $(ex) -eq 1 ] ; then \
echo "pixi not found, install? (CNTL-C to stop)" ; \
read ; \
curl -fsSL https://pixi.sh/install.sh | sh ; \
fi
@echo "installed"
# install pixi and the Python environments
.PHONY: init
init: installpixi
@echo "installing environment..."
@pixi install
# run base module tests
.PHONY: test
test:
@echo "running unit tests..."
@pixi run test
# run NLP specific tests
.PHONY: testnlp
testnlp:
@echo "running NLP unit tests..."
@pixi run testnlp
# run all tests
.PHONY: testall
testall: test testnlp
# build the wheel (clean first to ensure fresh build)
.PHONY: wheel
wheel: clean $(DIST_DIR)
@PX_DIST_DIR=$(DIST_DIR) pixi run build-wheel
.PHONY: clean
clean:
@echo "removing target: $(TARG_DIR)"
@rm -fr $(TARG_DIR)
# upload to test PyPI
.PHONY: upload-test
upload-test: wheel
@PX_DIST_DIR=$(DIST_DIR) pixi run -e build-pypi upload-test
# upload to PyPI
.PHONY: upload
upload: wheel
@PX_DIST_DIR=$(DIST_DIR) pixi run -e build-pypi upload
.PHONY: bump-alpha-minor-dry
bump-alpha-minor-dry:
@python tools/bump_version.py --alpha-minor --dry-run
.PHONY: bump-alpha-major-dry
bump-alpha-major-dry:
@python tools/bump_version.py --alpha-major --dry-run
.PHONY: bump-minor-dry
bump-minor-dry:
@python tools/bump_version.py --minor --dry-run
.PHONY: bump-major-dry
bump-major-dry:
@python tools/bump_version.py --major --dry-run
.PHONY: upload-test-alpha-minor
upload-test-alpha-minor:
@$(MAKE) bump-alpha-minor
@$(MAKE) upload-test
.PHONY: upload-test-alpha-major
upload-test-alpha-major:
@$(MAKE) bump-alpha-major
@$(MAKE) upload-test
.PHONY: upload-test-minor
upload-test-minor:
@$(MAKE) bump-minor
@$(MAKE) upload-test
.PHONY: upload-test-major
upload-test-major:
@$(MAKE) bump-major
@$(MAKE) upload-test
## Smart bump + upload helpers
#
# Usage examples:
# make upload-alpha-minor # 2.0a04 -> 2.0a05, then build & upload
# make upload-alpha-major # 2.0a04 -> 2.0a10, then build & upload
# make upload-minor # 2.0a04 -> 2.0.0 (or next free patch), then upload
# make upload-major # 2.0.1 -> 2.1.0, then build & upload
.PHONY: bump-alpha-minor
bump-alpha-minor:
@python tools/bump_version.py --alpha-minor
.PHONY: bump-alpha-major
bump-alpha-major:
@python tools/bump_version.py --alpha-major
.PHONY: bump-minor
bump-minor:
@python tools/bump_version.py --minor
.PHONY: bump-major
bump-major:
@python tools/bump_version.py --major
.PHONY: upload-alpha-minor
upload-alpha-minor:
@$(MAKE) bump-alpha-minor
@$(MAKE) upload
.PHONY: upload-alpha-major
upload-alpha-major:
@$(MAKE) bump-alpha-major
@$(MAKE) upload
.PHONY: upload-minor
upload-minor:
@$(MAKE) bump-minor
@$(MAKE) upload
.PHONY: upload-major
upload-major:
@$(MAKE) bump-major
@$(MAKE) upload