-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (54 loc) · 1.65 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
SHELL=/bin/bash
VERSION=$(shell git describe --tags)
GIT_STATUS_SUMMARY=$(shell git status --porcelain)
# Build distribution
build:
@echo "Check that directory is clean. Please commit all changes."
[ "${GIT_STATUS_SUMMARY}" = "" ] # [ "$$(git status --porcelain)" = "" ]
git describe --tags > VERSION
source dev/bin/activate.sh && python setup.py sdist bdist_wheel
# Clean the build
clean-build:
rm -rf dist && true
rm -rf build && true
# Clean up all
clean: clean-build
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" | xargs rm -r $1
rm -rf .venv && true
# Run unit tests with coverage
test:
source dev/bin/activate.sh && test-coverage.sh tests
# Run unit tests with dev
test-dev:
source dev/bin/activate.sh && test.sh --pdb tests
# Run all linters on python files
lint:
source dev/bin/activate.sh \
&& pylint.sh classyjson tests \
&& flake8.sh classyjson.py tests \
&& black.sh --check classyjson.py tests \
&& mypy.sh classyjson.py
lint-types:
source dev/bin/activate.sh \
&& mypy.sh classyjson.py
# Display version
version:
@echo ${VERSION}
# Create virtual environment
venv:
source dev/bin/activate.sh && which python
prepublish:
source dev/bin/activate.sh && twine check dist/*
tar tzf dist/classyjson-*.tar.gz
# Show help
help:
@echo ""
@echo "Usage: make <target>"
@echo "Targets:"
@grep -E "^[a-z,A-Z,0-9,-]+:.*" Makefile | sort | cut -d : -f 1 | xargs printf ' %s\n'
@echo ""
.DEFAULT_GOAL=help
.PHONY: build clean-build clean help lint-types lint test-dev test venv version
# echo .PHONY: $(grep -E "^[a-z,A-Z,0-9,-]+:.*" Makefile | sort | cut -d : -f 1 | xargs)