1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-30 06:35:24 +00:00
toot/Makefile

68 lines
1.5 KiB
Makefile
Raw Normal View History

2020-06-15 19:27:41 +00:00
.PHONY: clean publish test docs
2017-04-12 14:42:04 +00:00
dist :
2018-06-25 12:27:40 +00:00
python setup.py sdist --formats=gztar,zip
python setup.py bdist_wheel --python-tag=py3
2017-04-12 14:42:04 +00:00
publish :
twine upload dist/*.tar.gz dist/*.whl
2018-06-25 12:27:40 +00:00
test:
pytest -v
flake8
2023-11-18 21:20:06 +00:00
vermin toot
2018-06-25 12:27:40 +00:00
coverage:
2022-11-29 10:25:52 +00:00
coverage erase
coverage run
2023-12-03 06:07:18 +00:00
coverage html --omit "toot/tui/*"
2022-11-29 10:25:52 +00:00
coverage report
2017-08-26 13:56:41 +00:00
2018-06-25 12:27:40 +00:00
clean :
find . -name "*pyc" | xargs rm -rf $1
rm -rf build dist MANIFEST htmlcov bundle toot*.tar.gz toot*.pyz
2019-09-04 06:39:18 +00:00
changelog:
./scripts/generate_changelog > CHANGELOG.md
2023-03-03 12:52:37 +00:00
cp CHANGELOG.md docs/changelog.md
docs: changelog
mdbook build
docs-serve:
mdbook serve --port 8000
2023-03-03 12:52:37 +00:00
docs-deploy: docs
rsync --archive --compress --delete --stats book/ bezdomni:web/toot
2023-12-14 11:53:32 +00:00
.PHONY: bundle
bundle:
mkdir bundle
cp toot/__main__.py bundle
pip install . --target=bundle
rm -rf bundle/*.dist-info
find bundle/ -type d -name "__pycache__" -exec rm -rf {} +
python -m zipapp \
--python "/usr/bin/env python3" \
--output toot-`git describe`.pyz bundle \
--compress
echo "Bundle created: toot-`git describe`.pyz"
# TODO: add more rules for more shells
.PHONY: install-shell-completion
install-shell-completion: install-bash-completion
@echo "See docs/shell_completion.md for Fish and Zsh completions"
.PHONY: install-bash-completion
install-bash-completion:
if test -d /etc/bash_completion.d; then \
$(MAKE) bash-completion && \
cp bash-completion /etc/bash_completion.d/toot; \
fi
# TODO: encode dependencies instead (on bundle?)
.PHONY: bash-completion
bash-completion:
_TOOT_COMPLETE=bash_source toot > $@.tmp && mv -f $@.tmp $@