-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (47 loc) · 1.46 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
PYTHON := python
PIP := $(PYTHON) -m pip
PYV=$(shell $(PYTHON) -c "import sys;t='{v[0]}{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")
.PHONY: help lint clean build
help: # The following lines will print the available commands when entering just 'make'
ifeq ($(UNAME), Linux)
@grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
else
@awk -F ':.*###' '$$0 ~ FS {printf "%15s%s\n", $$1 ":", $$2}' \
$(MAKEFILE_LIST) | grep -v '@awk' | sort
endif
clean: clean-pyi ### Cleans artifacts
clean-pyi: ### Clean python compiled interface files
find . -name "*.pyi" -delete
install-deps:
$(PIP) install .
install-deps-dev:
$(PIP) install .[dev]
install-deps-packaging:
$(PIP) install .[packaging]
install-all:
$(PIP) install .[dev,packaging]
define BUILD
find . -name "*.pyi" -delete && rm -rf build dist && \
echo version = \"$(version)\" > $1/__version__.py && \
stubgen . -o . --export-less && \
$(PYTHON) -m build --wheel
twine check dist/*
endef
define UPLOAD
twine upload -r ydata dist/*
endef
define WHEEL
cd dist && \
mv $1-$(version)-py3-none-any.whl $1-$(version)-py$(PYV)-none-any.whl && \
$(PYTHON) -m pyc_wheel $1-$(version)-py$(PYV)-none-any.whl --exclude "__version__.py" && \
twine check *
endef
build:
$(call BUILD,sketch_dask_extension)
lint:
pre-commit run --all-files
upload:
$(call UPLOAD)
wheel:
$(call WHEEL,sketch_dask_extension)