/
makefile
86 lines (66 loc) · 1.79 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
# Default
all: test
.PHONY: all
OS := $(shell uname | tr '[:upper:]' '[:lower:]')
CURRENT_DIR=$(shell pwd)
ifeq (,$(shell which conda))
HAS_CONDA=False
else
HAS_CONDA=True
endif
###
# Package
###
install:
ifeq (True,$(HAS_CONDA))
@echo ">>> Detected conda, creating conda environment."
conda env create -f environment_$(OS).yml
@echo ">>> Conda env created."
else
@echo ">>> Please install conda first: brew cask install anaconda"
endif
## Export conda environment
update_env:
ifeq (True,$(HAS_CONDA))
@echo ">>> Detected conda, exporting conda environment."
conda env update --name leniax --file environment_$(OS).yml
@echo ">>> Conda env exported."
else
@echo ">>> Please install conda first: brew cask install anaconda"
endif
## Export conda environment
export_env:
ifeq (True,$(HAS_CONDA))
@echo ">>> Detected conda, exporting conda environment."
conda env export -n leniax | grep -v "^prefix: " > environment_$(OS).yml
@echo ">>> Conda env exported."
else
@echo ">>> Please install conda first: brew cask install anaconda"
endif
.PHONY: install export_env
docs: ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs clean
$(MAKE) -C docs html
.PHONY: docs
##
# CI
###
yapf:
yapf --style tox.ini -r -i leniax/. tests/. examples/. scripts/. tools/. benchmarks/.
lint:
flake8 leniax/. tests/. examples/. scripts/. tools/. benchmarks/.
typecheck:
mypy $(CURRENT_DIR)/leniax $(CURRENT_DIR)/examples $(CURRENT_DIR)/scripts
test:
pytest --disable-pytest-warnings tests
test-examples: ## test examples are working
bash tests/examples.sh
ci: lint typecheck test test-examples
.PHONY: typecheck yapf lint test test-examples ci
###
# Deploy
###
zip:
python setup.py sdist --format zip
.PHONY: zip
# ffmpeg -r 13 -i %05d.png -c:v libx264 -vf fps=26 -pix_fmt yuv420p beast.mp4