-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (47 loc) · 1.67 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
# Generated by Medikit 0.4.3 on 2017-12-03.
# All changes will be overriden.
PACKAGE ?= mused
PYTHON ?= $(shell which python)
PYTHON_BASENAME ?= $(shell basename $(PYTHON))
PYTHON_DIRNAME ?= $(shell dirname $(PYTHON))
PYTHON_REQUIREMENTS_FILE ?= requirements.txt
PYTHON_REQUIREMENTS_DEV_FILE ?= requirements-dev.txt
QUICK ?=
PIP ?= $(PYTHON_DIRNAME)/pip
PIP_INSTALL_OPTIONS ?=
VERSION ?= $(shell git describe 2>/dev/null || git rev-parse --short HEAD)
DJANGO ?= $(PYTHON) manage.py
YAPF ?= $(PYTHON) -m yapf
YAPF_OPTIONS ?= -rip
YARN ?= $(shell which yarn)
NODE ?= $(shell which node)
.PHONY: clean format install install-dev runserver update update-requirements
# Installs the local project dependencies.
install:
if [ -z "$(QUICK)" ]; then \
$(PIP) install -U pip wheel $(PIP_INSTALL_OPTIONS) -r $(PYTHON_REQUIREMENTS_FILE) ; \
$(YARN) install --production ; \
$(YARN) --version ; \
fi
# Installs the local project dependencies, including development-only libraries.
install-dev:
if [ -z "$(QUICK)" ]; then \
$(PIP) install -U pip wheel $(PIP_INSTALL_OPTIONS) -r $(PYTHON_REQUIREMENTS_DEV_FILE) ; \
$(YARN) install ; \
fi
# Cleans up the local mess.
clean:
rm -rf build dist *.egg-info
# Update project artifacts using medikit, after installing it eventually.
update:
python -c 'import medikit; print(medikit.__version__)' || pip install medikit;
$(PYTHON) -m medikit update
# Remove requirements files and update project artifacts using medikit, after installing it eventually.
update-requirements:
rm -rf requirements*.txt
$(MAKE) update
runserver: install-dev
$(DJANGO) runserver
format: install-dev
$(YAPF) $(YAPF_OPTIONS) .
$(YAPF) $(YAPF_OPTIONS) Projectfile