Skip to main content

Hot Module Reloading for Textual apps

Project description

textual-hmr

PyPI - Version

Provides Hot Module Reloading for Textual apps.

It acts as a small runner for Textual development: save Python files, and the current app instance exits so the updated app can be started again in the same Python process. When you export an App subclass, textual-hmr also enables Textual's built-in CSS watching by default.

CLI Usage

If your app class is named DemoApp in ./main.py, run:

textual-hmr ./main.py:DemoApp

Or use a module import path:

textual-hmr my_package.main:DemoApp

The target may be:

  • an App subclass
  • an App instance
  • a zero-argument callable returning an App

Options

textual-hmr --help

The command supports:

  • --watch PATH: additional file or directory paths to watch
  • --ignore PATH: file or directory paths to ignore
  • --headless: run without terminal output
  • --inline: use Textual inline mode
  • --inline-no-clear: preserve inline output after exit
  • --no-mouse: disable mouse support
  • --clear: clear the terminal before restarting after changes
  • --no-watch-css: do not enable Textual's CSS watcher when the target is an App subclass

Notes

  • This package is currently optimized for the common dev loop of restarting a Textual app quickly in-process when code changes.
  • It does not attempt to preserve widget state across app restarts.
  • For CSS-only changes, Textual's own watcher is usually the smoother path; textual-hmr enables that automatically for exported app classes unless you disable it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textual_hmr-0.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file textual_hmr-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: textual_hmr-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for textual_hmr-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49147eb459dac52408e54aab02d4980d8be180ee92bb66b0180e20bfa2a881dd
MD5 5b806563f7799c0e9181dc2c7930a56d
BLAKE2b-256 9997d990ee0ecc6aa0ab1b7fa106d6e421d6175e37ca4e14ef7e167a993e2815

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page