Skip to content

Packaging

rafageist edited this page Dec 4, 2026 · 6 revisions

Packaging

Use it for depending on TurboFrame from your project, shipping a binary, the licence
Needs TurboFrame from GitHub (a release tag); the extras your application imports

Depending on TurboFrame

TurboFrame is distributed from GitHub, not PyPI: its Releases carry the wheel, the sdist and their SHA256SUMS. Pin a release tag in your pyproject.toml:

[project]
dependencies = [
    "turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.3.0",   # the extras you use
]

[project.optional-dependencies]
dev = ["pytest>=8", "pytest-asyncio>=0.23",
       "turboframe[i18n] @ git+https://github.com/divengine/turboframe@v0.3.0"]    # catalogues: a development tool
acceptance = ["turboframe[terminal] @ git+https://github.com/divengine/turboframe@v0.3.0"]

List only the extras your application imports: each extra is needed only by its own module (see Installation).

A direct reference (@ git+...) is allowed in your project's dependencies, but PyPI refuses packages that have one. To publish your application on PyPI, TurboFrame would have to be there too, which it is not. Distribute your application from GitHub, or as a binary.

Moving to a newer TurboFrame is a change of that tag, tested like any other change. Each release's notes list what changed and, before 1.0, how to migrate from an API change. A full commit SHA works the same way, to try a fix before it is released.

What TurboFrame installs

  • Textual 8.2 (>=8.2,<9) and textual-vision 0.0.1 (exactly: TurboFrame uses parts of it that may change);
  • its Spanish catalogue (turboframe/locale/es/LC_MESSAGES/turboframe.mo), as package data;
  • with [watch]: watchdog (>=6,<8), for turboframe.watch and the explorer's folder watching;
  • with [lsp]: pygls (>=2.1,<3), with its lsprotocol, for turboframe.lsp.session and turboframe.ui.lsp;
  • with [i18n]: Babel (>=2.12), for python -m turboframe.i18n_tools; your application does not need it at run time;
  • with [terminal]: tui-test 0.1.1 and psutil (>=7), for turboframe.testing.terminal.

Syntax colours in the editor come from Textual's tree-sitter grammars: add textual[syntax] to your dependencies if you use turboframe.ui.editor.

A binary

Tools that freeze an application, such as PyInstaller, must keep the data files and the modules that are imported dynamically: TurboFrame's catalogue (otherwise its texts fall back to English), Textual's and textual-vision's CSS, and Pygments' lexers. The applications TurboFrame comes from build theirs like this:

pyinstaller --collect-all turboframe --collect-all textual --collect-all textual_vision \
            --collect-submodules pygments --name myapp src/myapp/__main__.py

In a .spec file, the same is collect_all(package) for each of the three, and collect_submodules("pygments").

With the extras, collect their packages the same way: --collect-all watchdog for watch, --collect-all pygls --collect-all lsprotocol for lsp; with textual[syntax], tree-sitter and its grammars (--collect-all tree_sitter, and each tree_sitter_* package you use: tree_sitter_python...). Your own catalogues are package data: keep myapp/locale (see Translating Your Application).

With the web extra, a binary also serves --web (see Web Mode): it needs TurboFrame's web files (--collect-data turboframe, or --collect-all turboframe above) and Textual's web driver, which Textual imports by name, so add --collect-submodules textual.drivers (with --collect-all textual it is there already). Each browser tab then starts the binary itself.

Check the binary in a real terminal (see Testing): start it, open a dialog, switch the language, exit.

Licence

TurboFrame is under the GPL-3.0-or-later. An application that includes it, as a dependency or in a binary, and is distributed, is distributed under GPL-compatible terms. See docs/licensing.md.

Clone this wiki locally