This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 2.01 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
BRANCH := $(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)
# by default, we'll bump the "build" part of the version, for non-releases
PART = build
# if the current version is a release and not a dev build, bump the patch part instead
VERSION := $(shell grep -Po '(?<=current_version = )[\w\d\.]+' .bumpversion.cfg)
ifeq (,$(findstring dev,$(VERSION)))
ifeq ($(PART),build)
PART = patch
endif
endif
# Minimal makefile for Sphinx documentation
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = docs_source
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
docs:
-rm -rf _build/
make html
aws s3 sync --delete _build/html/ s3://docs.pewresearch.tech/django_verifications/
python_lint_errors:
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,build,dist
python_lint_quality:
flake8 . --exit-zero --statistics --count --show-source --max-line-length=127 --ignore=E201,E202,E221,E251,E501,E722 --exclude=.git,__pycache__,build,dist
github_lint_flake8:
flake8 . --max-line-length 127 --ignore=E201,E202,E221,E251,E501,E722 --exclude=.git,__pycache__,build,dist | reviewdog -reporter=github-pr-check -f=flake8
python_test:
python3 -m unittest tests
python_build:
python3 setup.py sdist bdist_wheel
.ONESHELL:
bump:
git checkout $(BRANCH)
git pull origin $(BRANCH)
bumpversion --commit $(PART)
.ONESHELL:
sync_branch:
git checkout $(BRANCH)
git pull origin $(BRANCH)
git push origin $(BRANCH)
.ONESHELL:
release:
git checkout $(BRANCH)
git pull origin $(BRANCH)
bumpversion --commit --tag release
git push origin $(BRANCH) --follow-tags
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)