Repository navigation
TurboFrame 0.2.0
TurboFrame 0.2.0
Stage 1 is complete: TurboFrame now holds all the generic infrastructure that
divide and turbodoo built, the
editor, the explorer, the git windows and the language server among it. What stays in the applications, and
why, is in docs/extraction-matrix.md.
TurboFrame is distributed from GitHub only. It is not on PyPI.
Install
pip install "turboframe @ git+https://github.com/divengine/turboframe@v0.2.0"
pip install "turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.2.0" # with the extrasOr the wheel attached to this release (check it against SHA256SUMS).
Requirements
- Python 3.11 or later; tested on 3.11 and 3.12. Linux and Windows, both required in CI; macOS is not tested.
textual>=8.2,<9,textual-vision==0.0.1.- Optional extras, each imported only by its own module:
watch:watchdog>=6,<8, forturboframe.watch;lsp:pygls>=2.1,<3, forturboframe.lsp.sessionandturboframe.ui.lsp;i18n:babel>=2.12, forturboframe.i18n_tools, a development tool;terminal:tui-test==0.1.1,psutil>=7, forturboframe.testing.terminal.
New
| Module | What it is |
|---|---|
turboframe.files |
open and save a project's files without losing a byte (atomic, refusing a file changed on disk), list them, read them to search |
turboframe.watch |
folders watched through the system's notifications (extra watch) |
turboframe.lsp.session |
a language server's session: start it, its documents, completion, hovers, signatures, definitions, references (extra lsp) |
turboframe.config |
an application's settings in a JSON file: the store the components take |
turboframe.recent |
recently opened folders and files |
turboframe.i18n_tools |
extract, update, compile and check an application's catalogues (extra i18n) |
turboframe.testing.i18n |
catalogue checks for an application's tests |
turboframe.ui.editor |
CodeEditor, EditorWindow, OutputWindow, LogWindow: the editor with diagnostics, marks, gutter marks and completion |
turboframe.ui.completion |
the completion list and the signature box |
turboframe.ui.editing |
EditorMixin: new, open, save, save as, close, go to line |
turboframe.ui.searching |
SearchMixin: Find, Replace, Search again |
turboframe.ui.lsp |
LspMixin: the language server in the editor, references, problems, go back (extra lsp) |
turboframe.ui.findfiles |
find in files, bounded, with its results window |
turboframe.ui.explorer |
the project tree: file operations, members, git marks, folder watching |
turboframe.ui.localmenu |
the local menu (Alt+F10, right click) of any window |
turboframe.ui.git |
the git windows: changes, history, branches and stashes, blame, commit, with the features an application offers |
turboframe.ui.debugwindows |
a debugger's list windows and call stack |
turboframe.ui.palette |
the command palette and Go to file |
turboframe.ui.language |
Options > Language |
Also new in existing modules:
turboframe.i18n:Domain(an application's catalogue, switching TurboFrame's texts with it) andchoose_language;turboframe.process:communicate,command_line,split_arguments;turboframe.ui.themes:treesitter_tokens;turboframe.ui.compat:install_cell_scrollbars.
The wiki has a guide for each: https://github.com/divengine/turboframe/wiki.
Changes to existing modules
None breaks an import from v0.1.0:
turboframe.lspis now a package; its helpers are where they were.DesktopAppinstalls whole-cell scroll bars: Textual's eighth-cell thumbs are not CP437. SetCELL_SCROLLBARS = Falseto keep Textual's.- A
TVDialoghasready, set once its own start-up (its text selected) is done, andturboframe.testing.dialog_readywaits for it. Before, a key pressed in that moment could be selected with the text and replaced. ExplorerMixinandGitMixinhandeditors,open_fileanddiscard_editortoEditorMixinwhen an application has it.- The commands of the new components take TurboFrame's range,
FRAMEWORK_COMMANDS[2..50].
Fixed on the way
These fixes came from the applications' own copies:
- divide's catalogue tool missed texts marked
N_(); - divide's language server session left a server's children running; turbodoo's session, now TurboFrame's, kills its process group;
- new diagnostics or marks in an editor showed only after the next edit, because of TextArea's line cache;
- a folder opened in the explorer could be left unwatched on a slow machine (the same race exists in divide);
- divide's PHP lint killed a process without reaping it;
communicatereaps.
Verification
- 399 unit and component tests on Linux (Python 3.11 and 3.12) and Windows (Python 3.12), and the real-terminal tests on Linux and Windows.
- The release workflow builds the sdist and the wheel once, installs the wheel with its extras in clean environments on Linux and Windows, and runs the suites against it before publishing.
Integrating in divide and turbodoo
-
Dependency:
turboframe[watch,lsp,terminal] @ git+https://github.com/divengine/turboframe@v0.2.0, with the extras each app needs. -
Replaces, for each app, its copy of each module above. turbodoo also replaces its remaining copies of v0.1.0's modules: the acceptance support, the test helpers, the glyph test, and the desktop base of
tui/app.py(subclassDesktopApp). -
Changes needed: each app module becomes a subclass or a re-export plus its own parts, through the hooks each module documents:
- divide's
DivEditorsubclassesCodeEditor; - divide's server table, and turbodoo's Python setup and Odoo filters, plug into
LspMixin; - turbodoo sets
GitMixin.GIT_FEATURES = frozenset()to keep its narrower Git menu; - divide keeps its settings where they are with
JsonStore("divide", appdata=False).
- divide's
-
Behaviour changes to expect, listed in each PR (#37 to #48). divide gains:
- atomic saves that ask before overwriting a file changed on disk;
- Find wrapping around;
- the hover in a box.
turbodoo gains:
- whole-cell scroll bars;
- the cancel letter in the save question.
-
Verify: each app's unit, acceptance and real-terminal suites, the wheel in a clean environment, and the binary (it must collect
turboframewith itslocale/data). -
Rollback: pin v0.1.0; nothing else changes.