-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMakefile
88 lines (68 loc) · 1.96 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
all: help
.PHONY: help # Show this help
help:
@echo "List of Makefile targets:"
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20
.PHONY: requirements # Install requirements
requirements:
venv/bin/pip3 install .
.PHONY: requirements-dev # Install requirements-dev
requirements-dev:
venv/bin/pip3 install .[dev]
.PHONY: show # Show current installed version
show:
venv/bin/pip3 show pysolarmanv5
.PHONY: black # Run black
black:
venv/bin/python3 -m black pysolarmanv5/*.py utils/*.py
.PHONY: lint # Run lint
lint:
venv/bin/python3 -m pylint **/*.py || true
.PHONY: test # Run pytest
test:
venv/bin/pytest
.PHONY: clean # Clean
clean: clean-build clean-pyc clean-docs
.PHONY: clean-build # Clean build
clean-build:
rm -rf build/
rm -rf dist/
rm -rf .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
.PHONY: clean-pyc # Clean pyc
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
.PHONY: clean-docs # Clean docs
clean-docs:
rm -rf docs/_build
.PHONY: docs-requirements # Install docs requirements
docs-requirements: docs/requirements.txt
venv/bin/pip3 install -r docs/requirements.txt
.PHONY: docs # Build docs
docs: clean-docs
venv/bin/sphinx-build docs docs/_build
.PHONY: docs-livehtml # Build docs and serve
docs-livehtml:
venv/bin/sphinx-autobuild --open-browser docs docs/_build --watch pysolarmanv5/
.PHONY: build # Build
build: clean-build
venv/bin/python3 -m build
.PHONY: install-dev # Install in editable mode
install-dev:
venv/bin/python3 -m pip install -e .
.PHONY: install # Install
install:
venv/bin/python3 -m pip install .
.PHONY: upload # Upload to PyPI
upload:
venv/bin/python3 -m twine upload dist/*
.PHONY: venv-create # Create venv in venv/
venv-create:
python3 -m venv venv
.PHONY: venv-shell # Launch venv Python shell
venv-shell:
venv/bin/python3