-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (49 loc) · 1.44 KB
/
Makefile
File metadata and controls
58 lines (49 loc) · 1.44 KB
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
all: # Run everything
all: setup test lint clean
setup: # Setup dependencies
setup:
@pip install -r tests/requirements_dev.txt
@pip install -r requirements.txt
test: # Run tests with pytest and coverage
test:
@rm -rf assets/notebooks/hello-out.ipynb
coverage erase
coverage run -m pytest
rm assets/notebooks/hello-out.ipynb
coverage report -m
BLACK_OPTS := -l 95
lint: # Check with mypy, pyflakes, black
lint:
mypy runpynb/runpynb.py --ignore-missing-imports
python -m pyflakes runpynb/runpynb.py
python -m pyflakes runpynb/scripts/runpynb
python -m pyflakes tests/test_runpynb.py
black runpynb/* $(BLACK_OPTS)
black runpynb/scripts/runpynb $(BLACK_OPTS)
black tests/* $(BLACK_OPTS)
@echo "+ imports"
isort .
rmcr: # Remove carriage return in script
rmcr:
python ./assets/removeCR.py
clean: # Purge caches and output files
clean:
@rm -rf __pycache__
@rm -rf .pytest_cache
@rm -rf .mypy_cache
@rm -rf .coverage
@rm -rf assets/notebooks/hello-out.ipynb
prepack: # Prepare packaging for PyPi
prepack:
@rm -rf dist/ runpynb.egg-info/
@python setup.py sdist
tar -xf dist/runpynb-0.2.*.tar.gz
python ./assets/checkDistCR.py
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}'