-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
122 lines (96 loc) · 2.96 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#* Variables
SHELL := /usr/bin/env bash
PYTHON := python3
#* OpenAPI variables
TRAININGSET_YAML := openapi/trainingset.yaml
DATASOURCE_YAML := openapi/datasource.yaml
FEATURESTORE_YAML := openapi/featurestore.yaml
#* Poetry
.PHONY: poetry-download
poetry-download:
curl -sSL https://install.python-poetry.org | $(PYTHON) -
.PHONY: poetry-remove
poetry-remove:
curl -sSL https://install.python-poetry.org | $(PYTHON) - --uninstall
#* Installation
.PHONY: install
install:
poetry lock -n && poetry export --without-hashes > requirements.txt
poetry install -n
-poetry run mypy --install-types --non-interactive ./
.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install
#* OpenAPI clients
.PHONY: install-trainingset
install-trainingset:
poetry run openapi-python-client generate --meta none --path $(TRAININGSET_YAML)
.PHONY: update-trainingset
update-trainingset:
poetry run openapi-python-client update --meta none --path $(TRAININGSET_YAML)
.PHONY: install-datasource
install-datasource:
poetry run openapi-python-client generate --meta none --path $(DATASOURCE_YAML)
.PHONY: update-datasource
update-datasource:
poetry run openapi-python-client update --meta none --path $(DATASOURCE_YAML)
.PHONY: install-featurestore
install-featurestore:
poetry run openapi-python-client generate --meta none --path $(FEATURESTORE_YAML)
.PHONY: update-featurestore
update-featurestore:
poetry run openapi-python-client update --meta none --path $(FEATURESTORE_YAML)
#* Formatters
.PHONY: codestyle
codestyle:
poetry run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
poetry run isort --settings-path pyproject.toml ./
poetry run black --config pyproject.toml ./
poetry run flake8 --config setup.cfg domino_data/
.PHONY: formatting
formatting: codestyle
#* Linting
.PHONY: test
test:
poetry run pytest --cov=domino_data tests/
.PHONY: check-codestyle
check-codestyle:
poetry run isort --diff --check-only --settings-path pyproject.toml ./
poetry run black --diff --check --config pyproject.toml ./
poetry run flake8 --config setup.cfg domino_data/
poetry run darglint --verbosity 2 domino_data tests
.PHONY: mypy
mypy:
poetry run mypy --config-file pyproject.toml ./
.PHONY: check-safety
check-safety:
poetry check
# TODO remove pip ignore flag when fixed
poetry run safety check --full-report -i 62044 -i 70612
poetry run bandit -ll --recursive domino_data tests
.PHONY: lint
lint: test check-codestyle mypy check-safety
#* Cleaning
.PHONY: pycache-remove
pycache-remove:
find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf
.PHONY: build-remove
build-remove:
rm -rf build/
.PHONY: clean
clean: pycache-remove build-remove docs-remove
#* Docs
.PHONY: docs
docs:
cd docs; poetry run make html
.PHONY: open-docs
open-docs:
open docs/build/html/index.html
.PHONY: docs-remove
docs-remove:
cd docs; poetry run make clean
#* Submodules
update-submodules:
git submodule update --recursive --remote
gen-services:
poetry run python scripts/gen.py