-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
61 lines (47 loc) · 1.32 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
SHELL := /bin/bash
VENV = venv
PYTHON = ${VENV}/bin/python3
PIP = ${VENV}/bin/pip3
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
current_dir_full_path := $(abspath $(current_dir))
# -----------------------------------------------------------------------------
# LOCAL USAGE
# Create a virtual environment
.PHONY: venv
venv:
python3 -m venv venv
source venv/bin/activate
# Install dependencies
py-install: requirements.txt
${PIP} install -r requirements.txt
# Updates the requirements.txt
update-python-pkgs:
pip-compile requirements.in
node-install:
npm install
# Runs migrations and runs the local development server
runserver: py-install
${PYTHON} email_signals/manage.py migrate
${PYTHON} email_signals/manage.py runserver
# Runs tests
test: py-install
${PYTHON} runtests.py
# Runs test with all environments defined in the `tox.ini` file
tox:
tox -s
# Runs formatter
format: py-install
${PYTHON} -m black email_signals/.
# Runs linter
lint: py-install
${PYTHON} -m flake8 --exclude=migrations email_signals/.
# Builds node packages
build-node: node-install
npm run build
# Builds the package ready for deployment
build-package:
${PYTHON} setup.py sdist bdist_wheel
# Uploads the package to PyPI
upload-package:
${PYTHON} -m twine upload dist/*