-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
68 lines (50 loc) · 1.8 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
# Set path so we can find poetry after install
PATH := $(PATH):$(HOME)/.local/bin
deps:
sudo apt update
sudo apt install -y python3.9 python3.9-venv libpython3.9-dev libpq-dev graphicsmagick gcc python-dev
# Install node: https://github.com/nodesource/distributions/blob/master/README.md#deb
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install poetry: https://python-poetry.org/docs/#installing-with-the-official-installer
curl -sSL https://install.python-poetry.org | python3.9 -
sudo npm install -g yarn
sudo apt install -y postgresql
sudo systemctl start postgresql
# this should only be used for development
initdevdb:
sudo -u postgres psql -c "create user arlo superuser password 'arlo';"
sudo -u postgres psql -c "create database arlo with owner arlo;"
install-development:
poetry install
yarn install
yarn --cwd client install
setup-git-hooks:
yarn prepare
resettestdb:
FLASK_ENV=test make resetdb
resetdb:
FLASK_ENV=$${FLASK_ENV:-development} poetry run python -m scripts.resetdb
migratedb:
FLASK_ENV=$${FLASK_ENV:-development} poetry run alembic upgrade head
dev-environment: deps initdevdb install-development setup-git-hooks resetdb
typecheck-server:
poetry run mypy server scripts fixtures
format-server:
poetry run black .
lint-server:
poetry run pylint server scripts fixtures
test-client:
yarn --cwd client lint
yarn --cwd client test
test-server:
poetry run pytest -n auto --ignore=server/tests/arlo-extra-tests
test-server-coverage:
poetry run pytest -n auto --cov=. --ignore=server/tests/arlo-extra-tests
# This runs all tests. If you have the extra files repo included, it runs those as well.
test-server-extra:
poetry run pytest -n auto
test-server-extra-coverage:
poetry run pytest -n auto --cov=.
run-dev:
./run-dev.sh