forked from TheFerry10/TagesschauScraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (43 loc) · 1.25 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
PYTHON=python3.9
ENV_NAME=.env
SHELL := /bin/bash
DIRS = examples tagesschauscraper tests
export PYTHONPATH=.
.PHONY: clean
clean:
find . -name "*.swp" -o -name "__pycache__" -o -name ".mypy_cache" | xargs rm -fr
rm -fr $(ENV_NAME)
.PHONY: setup
setup:
$(PYTHON) -m venv $(ENV_NAME)
$(ENV_NAME)/bin/python -m pip install --upgrade pip
$(ENV_NAME)/bin/python -m pip install -r requirements.txt
.PHONY: unittest
unittest:
$(ENV_NAME)/bin/python -m doctest tests/unit/*.py
$(ENV_NAME)/bin/python -m pytest tests/unit/*.py
.PHONY: integrationtest
integrationtest:
$(ENV_NAME)/bin/python -m doctest tests/integration/*.py
$(ENV_NAME)/bin/python -m pytest tests/integration/*.py
.PHONY: test
test: unittest integrationtest
.PHONY: build
build:
pandoc -f markdown -t rst -o README.rst README.md
$(ENV_NAME)/bin/python setup.py sdist bdist_wheel
rm README.rst
.PHONY: typehint
typehint:
$(ENV_NAME)/bin/python -m mypy $(DIRS)
.PHONY: format
format:
$(ENV_NAME)/bin/python -m black --line-length=79 --preview $(DIRS)
.PHONY: lint
lint:
$(ENV_NAME)/bin/python -m flake8 $(DIRS) --ignore=E501 --max-line-length=79
.PHONY: checklist
checklist: typehint format lint test
.PHONY: convert_readme
convert_readme:
pandoc -f markdown -t rst -o README.rst README.md