-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (39 loc) · 1.42 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
.PHONY: help
help: ## List make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: format
format: ## Format source code
poetry run isort .
poetry run black .
.PHONY: lint
lint: ## Lint source code
poetry run flake8 src tests
.PHONY: test
test: ## Run tests
poetry run pytest --color=yes
.PHONY: test-live
test-live: ## Run live tests
tests/live.sh
.PHONY: coverage
coverage: ## Generate and open coverage report
poetry run coverage run --source=pricehist -m pytest
poetry run coverage html
xdg-open htmlcov/index.html
.PHONY: install-pre-commit-hook
install-pre-commit-hook: ## Install the git pre-commit hook
echo -e "#!/bin/bash\nmake pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
.PHONY: pre-commit
pre-commit: ## Checks to run before each commit
poetry run isort src tests --check
poetry run black src tests --check
poetry run flake8 src tests
.PHONY: tox
tox: ## Run tests via tox
poetry run tox
.PHONY: fetch-iso-data
fetch-iso-data: ## Fetch the latest copy of the ISO 4217 currency data
wget -O src/pricehist/resources/list-one.xml \
https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml
wget -O src/pricehist/resources/list-three.xml \
https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-three.xml