-
-
Notifications
You must be signed in to change notification settings - Fork 3
Building and Packaging
This guide explains how to set up a development environment, run the test suite, build standalone binaries, and produce distribution packages for Linux and Windows.
Mastui uses Poetry for dependency management and packaging.
- Python 3.9 or newer (Python 3.11/3.12 recommended)
- Git
- Poetry (
pip install poetryorpipx install poetry)
git clone https://github.com/kimusan/mastui.git
cd mastui
# Install dependencies in an isolated virtual environment
poetry install# Launch Mastui in standard TUI mode
poetry run mastui
# Launch with verbose debug logging (press F12 in-app to view logs)
poetry run mastui --debug
# Launch in Web Interface mode
poetry run mastui --webAlways ensure tests pass and code is formatted before submitting pull requests:
# Run pytest test suite
poetry run pytest
# Run specific test file
poetry run pytest tests/test_web.py
# Check code style with Ruff
poetry run ruff check .
# Auto-format sources with Ruff
poetry run ruff format .Mastui includes an automated packaging tool scripts/build_packages.py that generates standalone executables and distro packages using PyInstaller.
The standalone executable bundles Python runtime, Textual, dependencies, and project assets (CSS files, logo):
- Bundles
mastui/mastui.tcssinto the binary. - Configures proper hidden imports for
textual_image,PIL,html2text, etc.
To build all Linux formats (.deb, .rpm, .AppImage, Arch .pkg.tar.zst, and SHA256SUMS.txt):
poetry run python scripts/build_packages.py --all-linuxGenerated artifacts are placed in the dist/ directory:
-
dist/mastui(Standalone ELF executable) -
dist/mastui_<version>_amd64.deb(Debian/Ubuntu package) -
dist/mastui-<version>-1.x86_64.rpm(RedHat/Fedora/openSUSE package) -
dist/mastui-<version>-x86_64.AppImage(Universal Linux AppImage) -
dist/mastui-<version>-1-x86_64.pkg.tar.zst(Arch Linux package) -
dist/SHA256SUMS.txt(Cryptographic SHA-256 verification sums)
# Standalone binary only (dist/mastui)
poetry run python scripts/build_packages.py --target binary
# Debian package (.deb) - requires dpkg-deb on host
poetry run python scripts/build_packages.py --target deb
# RPM package (.rpm) - requires rpmbuild on host
poetry run python scripts/build_packages.py --target rpm
# AppImage (.AppImage) - auto-downloads appimagetool if not found
poetry run python scripts/build_packages.py --target appimage
# Arch Linux package (.pkg.tar.zst) - requires tar and zstd
poetry run python scripts/build_packages.py --target arch
# Windows ZIP bundle (.zip) - run from Windows host
poetry run python scripts/build_packages.py --target windows
# Re-generate SHA256 checksums
poetry run python scripts/build_packages.py --target checksumsMastui uses GitHub Actions for automated testing and releases:
-
.github/workflows/ci.yml: Runs on every push and pull request across Linux, macOS, and Windows to executeruff checkandpytest. -
.github/workflows/release.yml: Triggers whenever a version tag (v*.*.*) is pushed:- Builds native Linux distribution packages on
ubuntu-latest. - Builds Windows
.zipbinary bundle onwindows-latest. - Computes unified
SHA256SUMS.txt. - Automatically extracts changelog section from
CHANGELOG.md. - Publishes a GitHub Release with all binary assets attached.
- Publishes Python wheels and sdist to PyPI.
- Builds native Linux distribution packages on
Mastui Wiki — The fast, keyboard-driven terminal and web client for Mastodon.
GitHub Repository • Releases • Issues