-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
48 lines (35 loc) · 1.48 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
export PROJECTNAME=$(shell basename "$(PWD)")
.SILENT: ; # no need for @
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean: clean-pyc ## Clean package
rm -rf build dist
black: ## Runs black for code formatting
black app --exclude generated
lint: black ## Runs Flake8 for linting
flake8 app
setup: clean ## Re-initiates virtualenv
rm -rf venv
python3 -m venv venv
./venv/bin/python3 -m pip install -r requirements/dev.txt
deps: ## Reinstalls dependencies
./venv/bin/python3 -m pip install -r requirements/dev.txt
uic: res ## Converts ui files in resources/views to python
for i in `ls resources/views/*.ui`; do FNAME=`basename $${i} ".ui"`; ./venv/bin/pyuic5 $${i} > "app/generated/$${FNAME}_ui.py"; done
res: ## Generates and compresses resource listed in resources/resources.qrc
./venv/bin/pyrcc5 -compress 9 -o app/generated/resources_rc.py resources/resources.qrc
run: ## Runs the application
export PYTHONPATH=`pwd`:$PYTHONPATH && ./venv/bin/python3 app/__main__.py
icns: ## Generates icon files from svg
echo "Run ./mk-icns.sh resources/icons/app.svg app"
.PHONY: help
.DEFAULT_GOAL := setup
help: Makefile
echo
echo " Choose a command run in "$(PROJECTNAME)":"
echo
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
echo