-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (49 loc) · 1.24 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
# Makefile
SHELL = /bin/bash
.PHONY: help
help:
@echo "Commands:"
@echo "venv : creates a virtual environment."
@echo "style : executes style formatting."
@echo "clean : cleans all unnecessary files."
@echo "test : execute tests on code, data and models."
# Styling
.PHONY: style
style:
black .
flake8
python3 -m isort .
# Environment
.ONESHELL:
venv:
# conda create -n env_name python=3.9
# conda activate env_name
# Project
.ONESHELL:
project:
python3 -m pip install --upgrade pip setuptools wheel && \
python3 -m pip install -e ".[dev]" && \
pre-commit install && \
pre-commit autoupdate
# Cleaning
.PHONY: clean
clean: style
find . -type f -name "*.DS_Store" -ls -delete
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
find . | grep -E ".pytest_cache" | xargs rm -rf
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
find . | grep -E ".trash" | xargs rm -rf
rm -f .coverage
# Test
.PHONY: test
test:
pytest -m "not training"
cd tests && great_expectations checkpoint run projects
cd tests && great_expectations checkpoint run tags
cd tests && great_expectations checkpoint run labeled_projects
.PHONY: dvc
dvc:
dvc add data/projects.csv
dvc add data/tags.csv
dvc add data/labeled_projects.csv
dvc push