-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (41 loc) · 1.2 KB
/
Copy pathMakefile
File metadata and controls
51 lines (41 loc) · 1.2 KB
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
HOST := 0.0.0.0
PORT := 8008
IMAGE_NAME ?= shell_black_scholes
APP_NAME := $(IMAGE_NAME)
export USER ?= $(shell whoami)
TAG ?= $(USER)
BUILD_ARGS :=
run_args := -t -i --name $(APP_NAME) --rm -p $(HOST):$(PORT):$(PORT) -e HOST=$(HOST) -e PORT=$(PORT)
package_path := ./instruments/ ./market-data/ ./models/ ./securities/ ./*.py
.PHONY: all
all: build
.PHONY: build
build:
docker build $(BUILD_ARGS) -t $(IMAGE_NAME):$(TAG) .
.PHONY: build-dev
build-dev:
docker build $(BUILD_ARGS) -t $(IMAGE_NAME):$(TAG)-dev -f Dockerfile.dev .
.PHONY: clean-images
clean-images:
-docker rmi -f $(IMAGE_NAME):$(TAG)
# Development mode suitable for interactive use (debugging, profiling), not for CI
.PHONY: run-dev
run-dev: build-dev
docker run $(run_args) -v $(PWD):/shell $(IMAGE_NAME):$(TAG)-dev bash
.PHONY: run
run: lint build
docker run $(run_args) $(IMAGE_NAME):$(TAG)
.PHONY: run-local
run-local:
flask --app=pricing_engine run --host=$(HOST) --port=$(PORT)
.PHONY: lint
lint:
isort $(package_path)
black -l 120 $(package_path)
pylint --ignore=./tests $(package_path)
.PHONY: clean
clean:
rm -rf .pytest_cache ./tests/.pytest_cache ./__pycache__
.PHONY: test
test:
PYTHONPATH="." pytest -r ./tests/test_pricing_engine.py