-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.12 KB
/
Makefile
File metadata and controls
50 lines (37 loc) · 1.12 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
prj-dir := $(shell pwd)
src-dir := $(prj-dir)
venv-dir := $(prj-dir)/venv
python-native := python3
python := $(venv-dir)/bin/python
pytest := $(venv-dir)/bin/pytest
pip := $(venv-dir)/bin/pip
pip-compile := $(venv-dir)/bin/pip-compile
define get_site_dir
$(shell $(python) -c "import sysconfig; print(sysconfig.get_path(\"purelib\"))")
endef
init: create-env install-build-tools install-deps set-path gen
create-env:
$(python-native) -m venv $(venv-dir)
install-build-tools:
$(pip) install --upgrade pip
$(pip) install pip-tools
install-deps:
$(pip-compile) --strip-extras
$(pip) install -r requirements.txt
install-optional-deps:
$(pip) install .[test]
set-path:
echo $(src-dir) > $(call get_site_dir)/my.pth
run:
$(python) $(filter-out $@, $(MAKECMDGOALS))
test:
$(pytest)
gen:
$(prj-dir)/bin/gen_protocol_code.sh
publish:
$(python) -m build && twine check dist/* && twine upload -r pypi dist/*
publish-test:
$(python) -m build && twine check dist/* && twine upload -r pypitest dist/*
clean:
$(prj-dir)/bin/clean_protocol_code.sh
rm -rf $(venv-dir) $(prj-dir)/build $(prj-dir)/dist ${prj-dir}/maxwell_protocol.egg-info