-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (57 loc) · 2.08 KB
/
Makefile
File metadata and controls
72 lines (57 loc) · 2.08 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
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
.PHONY: tests, docs
help:
@Echo clean: runs autopep to improve formatting of code
@Echo reqs: replace requirements.txt file for use by collaborators to create virtual environments and for use in documentation
@Echo tests: runs unit tests
@Echo docs: clears files from docs folder, rebuilds docs from source folder
@Echo release: runs build to create tar and wheel for distribution
@Echo all: runs clean build and docs folders, creates new html folders in build, moves relevant files to docs, and runs unittests and autopep.
reqs:
@pip freeze > requirements.txt
clean:
# Running autopep8
@autopep8 -r --in-place teaspoon/
tests:
# Running unittests
@python -m unittest
release:
python setup.py sdist bdist_wheel
docs:
@mkdir $(shell pwd)/build/temp
# Removing all files from build folder.
@rm -rf $(shell pwd)/build/
@mkdir $(shell pwd)/build/
@mkdir $(shell pwd)/docs/temp
# Removing all files from docs folder.
@rm -rf $(shell pwd)/docs/
@mkdir $(shell pwd)/docs/
# Running sphinx-build to build html files in build folder.
sphinx-build -M html source build
@mkdir $(shell pwd)/docs/.doctrees
@cp -a $(shell pwd)/build/doctrees/. $(shell pwd)/docs/.doctrees/
@cp -a $(shell pwd)/build/html/. $(shell pwd)/docs/
all:
# Cleaning build folder
@mkdir $(shell pwd)/build/temp
@rm -rf $(shell pwd)/build/
@mkdir $(shell pwd)/build/
# Cleaning docs folder
@mkdir $(shell pwd)/docs/temp
@rm -rf $(shell pwd)/docs/
@mkdir $(shell pwd)/docs/
# Running sphinx-build to build html files.
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Copying over contents of build/html to docs
@mkdir $(shell pwd)/docs/.doctrees
@cp -a $(shell pwd)/build/doctrees/. $(shell pwd)/docs/.doctrees/
@cp -a $(shell pwd)/build/html/. $(shell pwd)/docs/
# Running autopep8
@autopep8 -r --in-place teaspoon/
# Running unittests
@python -m unittest