-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
91 lines (70 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
SRC=./aspose_barcode_cloud
.PHONY: all
all: format lint test-tox
.PHONY: check_git
check_git:
git fetch origin
git diff origin/main --exit-code
.PHONY: clean-git
clean-git:
git clean -dfx --exclude='tests/configuration*.json'
.PHONY: clean-pyc
clean-pyc:
find . -type f -name '*.pyc' -delete
.PHONY: dist
dist:
python setup.py sdist bdist_wheel --universal
.PHONY: format
format:
black --line-length=120 -v $(SRC) tests/ example.py scripts/
.PHONY: format_doc
format_doc:
# Trim white space
sed -i -e 's_[[:space:]]*$$__' README.md
# Replace true->True false->False: sed -e "s/\b\(false\|true\)/\u\1/g"
find . -type f -iname '*.md' -exec sed -i -e 's_\b\(false\|true\)_\u\1_g' '{}' \;
.PHONY: init
init:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt -r lint-requirements.txt -r test-requirements.txt
.PHONY: init-docker
init-docker:
python -m pip install -r publish-requirements.txt -r requirements.txt
.PHONY: lint
lint:
# stop the build if there are Python syntax errors or undefined names
python -m flake8 aspose_barcode_cloud --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude '.*'
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
python -m flake8 aspose_barcode_cloud --count --exit-zero --max-line-length=127 --statistics --extend-ignore=E501 --extend-exclude '.*'
.PHONY: publish
publish: check_git test-tox dist
python -m twine upload dist/*
.PHONY: publish-docker
publish-docker: init-docker unittest dist
python -m twine upload dist/* --verbose
.PHONY: test
test:
python -m pytest --cov=aspose_barcode_cloud tests/
.PHONY: cover
cover:
python -Werror -m pytest --cov-report html:coverage --cov=aspose_barcode_cloud tests/
.PHONY: unittest
unittest:
python -Werror -m unittest discover -v
.PHONY: test-example
test-example:
python -Werror example.py
.PHONY: test-tox
test-tox:
python -m tox $(SRC)
.PHONY: insert-examples
insert-examples:
./scripts/insert-example.bash
.PHONY: add-warnings
add-warnings:
./scripts/add-deprecation-warnings.bash
.PHONY: after-gen
after-gen: format insert-examples add-warnings format_doc
.PHONY: update
update:
echo "Not implemented"