-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.6 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
# Makefile
# Commands
.PHONY: lint test docker requirements requirements-test install prepare deploy
# Lint: Checks flake8, mypy, isort
lint:
@echo "Running isort..."
@isort --check-only .
@echo "Running lint..."
@black src
@flake8 src --exclude=venv* --max-line-length=120
@echo "Running mypy..."
@mypy src
# Tests: pytest from src folder with coverage and printing coverage report
test:
@echo "Running tests with coverage..."
@coverage run -m pytest test
@coverage report
# Requirements: installs test requirements
requirements-test:
@echo "Installing test requirements"
@pip install -r requirements_test.txt
# Requirements: installs requirements
requirements:
@echo "Installing requirements"
@pip install -r requirements.txt
# Deploy: Builds docker image
docker-build:
@echo "Building docker image..."
@docker compose build
@echo "Run docker compose up -d"
# Saves the docker images
docker-save: docker-build
@echo "Saving images to output/"
@mkdir -p output
@docker save hgvs-api |gzip > output/hgvs-api-docker.tar.gz
@docker save hgvs-seqrepo_rsync |gzip > output/hgvs-seqrepo_rsync-docker.tar.gz
@docker save hgvs-uta_db |gzip > output/hgvs-uta_db-docker.tar.gz
# Loads the docker images
docker-load:
@echo "Loading images from output/"
@gunzip -c output/hgvs-api-docker.tar.gz | docker load
@gunzip -c output/hgvs-seqrepo_rsync-docker.tar.gz | docker load
@gunzip -c output/hgvs-uta_db-docker.tar.gz | docker load
# Prepare venv
prepare:
@echo "Preparing venv..."
@python -m venv venv
@source venv/bin/activate
install: prepare requirements
deploy: install requirements_test test docker-build