forked from LSYS/LexicalRichness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (41 loc) · 1.16 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
all: # Run everything
all: setup test lint clean
setup: # Setup dependencies
setup:
@pip install -r requirements.txt
@pip install -r requirements_dev.txt
@pip install -r docs/requirements.txt
test: # Run tests with pytest and coverage
test:
@echo "+ $@"
coverage run -m pytest -v
coverage report -m
.PHONY: lint
lint: # Check with mypy, pyflakes, black
lint:
@echo "+ $@"
isort .
black setup.py $(BLACK_OPTS)
black lexicalrichness/lexicalrichness.py
black tests/test_lexicalrichness.py
python -m pyflakes setup.py
python -m pyflakes lexicalrichness/lexicalrichness.py
python -m pyflakes tests/test_lexicalrichness.py
clean: # Purge caches and output files
clean:
@rm -rf __pycache__
@rm -rf .pytest_cache
@rm -rf .mypy_cache
@rm -rf .coverage
prepack: # Prepare packaging for PyPi
prepack:
@rm -rf dist/ runpynb.egg-info/
python setup.py sdist
twine check dist/*
PACKAGE_FILES := build/ dist/ *.egg-info/ *.egg
cleanpack: # Remove distribution/packaging files
cleanpack:
@rm -rf $(PACKAGE_FILES)
.DEFAULT_GOAL := help
help: # Show Help
@egrep -h '\s#\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'