-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
50 lines (41 loc) · 854 Bytes
/
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
# Variables
SOURCE = ural
# Functions
define clean
rm -rf *.egg-info .pytest_cache build dist
find . -name "*.pyc" | xargs rm -f
find . -name __pycache__ | xargs rm -rf
rm -f *.spec
rm -rf .tox
endef
# Commands
all: lint test
test: unit
publish: clean lint test upload
$(call clean)
clean:
$(call clean)
deps:
pip3 install -U pip
pip3 install -r requirements.txt
format:
@echo Formatting source code using black
black $(SOURCE) scripts test setup.py -t py33
@echo
lint:
@echo Searching for unused imports...
importchecker $(SOURCE) | grep -v __init__ || true
importchecker test | grep -v __init__ || true
@echo
tld:
@echo Upgrading internals...
python -m ural upgrade
black ural/tld_data.py -t py33
@echo
unit:
@echo Running unit tests...
pytest -svvv
@echo
upload:
python setup.py sdist bdist_wheel
twine upload dist/*