forked from lightly-ai/lightly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (74 loc) · 1.7 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
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
.PHONY: clean clean-build clean-pyc clean-out docs help
.DEFAULT_GOAL := help
# TODO
help:
## make clean
clean: clean-tox clean-build clean-pyc clean-out
## remove build artifacts
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
## remove python file artifacts
clean-pyc:
find . -name '__pycache__' -exec rm -fr {} +
## remove hydra outputs
clean-out:
rm -fr outputs/
rm -fr lightly_outputs/
rm -fr lightning_logs/
rm -fr lightly_epoch_*.ckpt
rm -fr last.ckpt
## remove tox cache
clean-tox:
rm -fr .tox
# format code with isort and black
format:
isort .
black .
# check if code is formatted with isort and black
format-check:
@echo "⚫ Checking code format..."
isort --check-only --diff .
black --check .
# check style with flake8
lint: lint-lightly lint-tests
## check lightly style with flake8
lint-lightly:
pylint --rcfile=pylintrc lightly
## check tests style with flake8
lint-tests:
pylint --rcfile=pylintrc tests
## run tests
test:
pytest tests --runslow
test-fast:
pytest tests
## check typing
type-check:
mypy lightly tests
## run format checks
static-checks: format-check type-check
## run format checks and tests
all-checks: static-checks test
## build source and wheel package
dist: clean
python setup.py sdist bdist_wheel
ls -l dist
## install the package to active site
install: clean
pip install .
# uninstall package from active site
uninstall: clean
pip uninstall lightly
## run tests in tox envs
tox:
tox
## helper for renaming
find:
@read -p "Enter Term: " term; \
grep -rnw ./ -e "$$term"