-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (52 loc) · 1.34 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
SHELL = /bin/bash
.PHONY: help
help:
@echo "Commands:"
@echo "style : executes style formatting."
@echo "clean : cleans all unnecessary files."
@echo "test : runs all non training tests"
# @echo "conda_env : creates a conda environment."
# Styling
# Execute even if a file called style exists
.PHONY: style
style:
black .
flake8
isort .
# # Environment possibilities
# conda_env:
# conda create -n make_ocean python=3.9.11
# conda activate make_ocean && \
# python -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
# rm -f .coverage
# # Test code
# .PHONY: test
# test:
# pytest
# # Coverage
# # creates .coverage, coverage html(for human) and xml (for vscode extension) report
# .PHONY: coverage
# coverage:
# coverage run -m pytest
# coverage html
# coverage xml
# # Environment possibilities
# conda_env:
# conda create -n make_ocean python=3.9.11
# conda activate make_ocean && \
# python -m pip install -e . ".[dev]" && \
# pre-commit install && \
# pre-commit autoupdate
# run pre-commit
.PHONY: pre-commit
pre-commit:
pre-commit run --all-files