forked from beancount/fava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 2 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
.PHONY: docs test lint binaries gh-pages translations-push translations-fetch before-release release
all: fava/static/gen/app.js
fava/static/gen/app.js: fava/static/css/* fava/static/javascript/* fava/static/package.json
rm -f fava/static/package-lock.json
cd fava/static; npm install; npm run build
clean: mostlyclean
rm -rf build dist
rm -rf fava/static/gen
make -C gui clean
mostlyclean:
rm -rf .tox
rm -rf fava/static/node_modules
find . -type f -name '*.py[c0]' -delete
find . -type d -name "__pycache__" -delete
lint:
tox -e lint
cd fava/static; npm install; npm run lint
make -C gui lint
test:
tox
docs:
sphinx-build -b html docs build/docs
before-release: translations-push translations-fetch
contrib/scripts.py generate_bql_grammar_json
# Before making a release, CHANGES needs to be updated and version number in
# fava/__init__.py should be set to the release version.
# A tag and Github release should be created too.
#
# After the release, the version number should be bumped in fava/__init__.py
# (with '-dev') and gui/src/main.js and fava.pythonanywhere.com should be
# updated.
release: fava/static/gen/app.js before-release
python setup.py sdist bdist_wheel upload
# Extract translation strings and upload them to POEditor.com.
# Requires the environment variable POEDITOR_TOKEN to be set to an API token
# for POEditor.
translations-push:
pybabel extract -F fava/translations/babel.conf -k lazy_gettext -o fava/translations/messages.pot ./fava
contrib/scripts.py upload_translations
# Download translations from POEditor.com. (also requires POEDITOR_TOKEN)
translations-fetch:
contrib/scripts.py download_translations
# Build and upload the website.
gh-pages:
git checkout master
git checkout --orphan gh-pages
sphinx-build -b html docs _build
ls | grep -v '_build' | xargs rm -r
mv -f _build/* ./
rm -r _build
touch .nojekyll
git add -A
git commit -m 'Update gh-pages'
git push --force [email protected]:beancount/fava.git gh-pages:gh-pages
git checkout master
git branch -D gh-pages