Add `make bundle` for creating a pyz bundle

pull/444/head
Ivan Habunek 2023-12-05 08:51:09 +01:00
rodzic 24866bd4e4
commit e8dac36de3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F5F0623FF5EBCB3D
2 zmienionych plików z 19 dodań i 5 usunięć

10
.gitignore vendored
Wyświetl plik

@ -6,12 +6,14 @@
/.env
/.envrc
/.pytest_cache/
/book
/build/
/bundle/
/dist/
/htmlcov/
/tmp/
/toot-*.tar.gz
debug.log
/pyrightconfig.json
/tmp/
/toot-*.pyz
/toot-*.tar.gz
/venv/
/book
debug.log

Wyświetl plik

@ -20,7 +20,7 @@ coverage:
clean :
find . -name "*pyc" | xargs rm -rf $1
rm -rf build dist MANIFEST htmlcov toot*.tar.gz
rm -rf build dist MANIFEST htmlcov bundle toot*.tar.gz toot*.pyz
changelog:
./scripts/generate_changelog > CHANGELOG.md
@ -34,3 +34,15 @@ docs-serve:
docs-deploy: docs
rsync --archive --compress --delete --stats book/ bezdomni:web/toot
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"