forked from amcintosh/freshbooks-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
62 lines (52 loc) · 1.52 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
.PHONY: env, install-dev, tag, clean
.PHONY: generate-docs, test, check-style, check-types
PROJECT=freshbooks-python-sdk
GIT_URL="https://${GIT_CREDENTIALS_USR}:${GIT_CREDENTIALS_PSW}@github.com/freshbooks/$(PROJECT).git"
GIT_RELEASE_WORKING_DIR=/tmp/$(PROJECT)
ifeq ($(BRANCH_NAME),)
BRANCH_NAME="$$(git rev-parse --abbrev-ref HEAD)"
endif
env:
virtualenv -p python3.8 env
install-dev: env
pip install -r requirements-dev.txt
generate-docs:
rm -rf docs/build
rm -rf docs/html
sphinx-build -d "docs/build" -b "html" "docs/source" "docs/html"
rm -rf docs/build
tag:
@if [ "$(BRANCH_NAME)" != "main" ]; then \
echo "You must be on main to update the version"; \
exit 1; \
fi;
@if [ "$(VERSION_PART)" = '' ]; then \
echo "Must specify VERSION_PART to bump (major, minor, patch)."; \
exit 1; \
fi;
pip install bumpversion
./scripts/update_changelog.sh $(VERSION_PART)
git add CHANGELOG.md && \
git commit -m "🔖 Update CHANGELOG for release" && \
git push origin main
git stash && \
git fetch --all && \
git reset --hard origin/main && \
bumpversion $(VERSION_PART) && \
git push origin --tags && \
git push origin main && \
git stash pop
check-style:
flake8 freshbooks --count --show-source --statistics
flake8 tests --count --show-source --statistics
check-types:
mypy --install-types --non-interactive freshbooks
test:
py.test --junitxml=junit.xml \
--cov=freshbooks \
--cov-branch \
--cov-report=xml:coverage.xml \
--cov-config=setup.cfg \
tests
coverage report -m
test-all: test check-style check-types