-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
109 lines (56 loc) · 1.89 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
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
pipenv-opt ?= $(if $(python-version),--python $(python-version),)
pipenv ?= pipenv run
maturin ?= $(pipenv) maturin
pytest ?= $(pipenv) pytest
doctest ?= $(pipenv) python -m doctest
twine ?= $(pipenv) twine
bench-result-dir ?= assets
build-opt ?= --release
build-version-opt ?= $(if $(python-version),-i python$(python-version),)
.PHONY: setup install-deps install-perde
.PHONY: lint pep8 mypy clippy test test-codegen test-datagen fmt fmt-rs fmt-py doctest bench develop build coverage publish test-publish clean
default: setup lint test
setup: install-deps install-perde
install-deps:
pipenv install --dev --skip-lock $(pipenv-opt)
install-perde: develop
lint: pep8 mypy clippy fmt
test: doctest test-datagen
$(pytest) --benchmark-skip $(test-opt)
bench: test-datagen
$(pytest) --benchmark-only $(test-opt)
compare:
$(pipenv) python ./perde-tests/bench/compare.py
histogram:
$(foreach fmt,\
json yaml msgpack toml,\
$(pytest) --benchmark-only --benchmark-histogram $(bench-result-dir)/$(fmt) --benchmark-json=$(bench-result-dir)/json -m $(fmt);)
develop:
$(maturin) develop -m perde/Cargo.toml $(build-opt)
build:
$(maturin) build -m perde/Cargo.toml $(build-opt) $(build-version-opt)
publish: clean build
$(twine) upload -u $(PYPI_USER) -p $(PYPI_PASSWORD) target/wheels/*
test-publish: clean build
$(twine) upload -u $(TEST_PYPI_USER) -p $(TEST_PYPI_PASSWORD) -r testpypi target/wheels/*
clean:
cargo clean
pep8:
$(pipenv) flake8
mypy:
$(pipenv) mypy perde
clippy:
cargo clippy -- -D warnings
fmt: fmt-rs fmt-py
fmt-rs:
cargo fmt --all -- --check
fmt-py:
$(pipenv) black --check .
doctest:
$(pipenv) python docs/test.py
coverage:
grcov -s . -t html --llvm --branch -o coverage ./target/debug
test-codegen:
cargo run -p codegen -- perde-tests/tests perde-tests/gen/datagen/src/main.rs
test-datagen: test-codegen
cargo run -p datagen -- perde-tests/data