-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
76 lines (56 loc) · 1.53 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
69
70
71
72
73
74
75
76
.DEFAULT_GOAL := lint
flake8:
flake8 . --show-source --statistics
mypy:
mypy . --show-column-numbers
check-isort:
isort . --check-only --diff
# Run linter
lint: flake8 mypy check-isort
isort:
isort .
black:
black src
# Run formatter
format: black isort
# Build dockerfile
build:
docker build -t cointaxman:latest .
# Run the project
run:
python src/main.py
# Shortcut for development (developer run)
drun: format lint run
run-container:
docker run --name cointaxman -it --rm \
-v `pwd`/account_statements:/CoinTaxman/account_statements:Z \
-v `pwd`/data:/CoinTaxman/data:Z \
-v `pwd`/export:/CoinTaxman/export:Z \
-e TAX_YEAR=2021 -e COUNTRY=GERMANY \
cointaxman
clean:
del /S data\*.db
cleanrun: clean run
check-db:
cd src && python -c "from price_data import PriceData; PriceData().check_database()"
# Install requirements
install:
python -m pip install --upgrade pip
pip install -r requirements.txt
install-dev: install
pip install -r requirements-dev.txt
# Setup virtual environment
venv:
python3 -m venv .venv
ifdef OS # Windows
.venv\Scripts\activate && make install
else # Linux
source .venv/bin/activate && make install
endif
# Rebuild requirements(-dev).txt
build-deps:
pip-compile --output-file requirements.txt dependencies/requirements.in
pip-compile --output-file requirements-dev.txt dependencies/requirements-dev.in
archive:
python src/archive_evaluation.py
.PHONY: flake8 mypy check-isort lint isort black format build run run-container clean cleanrun check-db install install-dev venv build-deps archive