Skip to content

TurboFrame 0.2.1

Choose a tag to compare

@github-actions github-actions released this 03 Dec 15:40
· 35 commits to main since this release
75dbdee

TurboFrame 0.2.1

A maintenance release. It fixes the defects that divide and
turbodoo met while adopting v0.2.0, and offers one opt-in way to hold
\n text in the editor while a file keeps its own newlines. Nothing else: no new component and no stage 2
work. Every v0.2.0 import still works, and every signature only gains optional arguments.

TurboFrame is distributed from GitHub only. It is not on PyPI.

Install

pip install "turboframe @ git+https://github.com/divengine/turboframe@v0.2.1"
pip install "turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.2.1"   # with the extras

Or 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, and now rich>=14.2, declared (it came with Textual before; the
    floor is the one Textual 8.2 requires, so no environment changes).
  • The extras are the same; lsp now also names lsprotocol>=2025.0.0, which pygls already pins.

Fixed

Issue What was wrong Now
#56 process.split_arguments kept the quotes inside the arguments on Windows (shlex.split(posix=False)) Windows splits by the Microsoft C runtime's rules, the inverse of command_line (subprocess.list2cmdline): 'one "two words"' is ["one", "two words"], C:\Users\me stays as typed
#51 process.communicate returned empty output when the time ran out it returns what the process wrote until then, with timed_out=True
#50 ui.history.add raised OSError into the dialog when the store could not be written nothing is kept and the dialog goes on, as the other settings do
#53 GitMixin.git_command returned None; the language servers' temporary folder was ~/.cache on Windows git_command returns True for GIT_COMMANDS, False otherwise; the folder is %LOCALAPPDATA% on Windows ($XDG_CACHE_HOME still wins when set)
#52 the package docstring said it held no components; Rich was imported but not declared both fixed; a test checks that every package src/ imports is declared
#54 the palette listed the folder's files on the event loop each time it opened, the command palette too the dialog opens at once and the files are read in a thread; Go to file says "Reading the folder's files..." meanwhile
#58 an Enter typed before Go to file's list was filled was dropped it acts on the list as soon as it is filled: a name and Enter typed at once open the file
#59 Window > Tile (desktop.tile()) put the editors over the explorer the desktop (ui.desktop.DeskTop) tiles beside the docked windows: shown, not tileable, not zoomed, against the left or right edge
#60 an opened editor took the focus back from a window the application raised over it the editor is focused only while its window is still the active one
#55 the Browse title was not translated; ListWindow.EMPTY was looked up in TurboFrame's catalogue only; init_status_line() ran twice translated; ListWindow.empty_text() is the hook an application overrides with its domain; it runs once

Each fix has a regression test that fails on v0.2.0.

New, opt-in: \n text with the file's newlines kept

By default nothing changes: an editor's text is the file's, \r\n included, and a save writes it back byte for
byte. An application whose offsets count \n newlines (lexers, outlines, member text) can now ask for \n text
instead, and the file keeps its newlines:

from turboframe.ui.editor import EditorWindow

class MyWindow(EditorWindow):
    LF = True   # the editor holds \n text; a save writes the file's own newlines back

Underneath, for code outside the editor:

  • files.read_source(path, lf=True) returns \n text, and SourceFile.newline names the file's newline (its
    most frequent; \n for a file without newlines);
  • files.write_source(..., newline=) writes every newline as that one;
  • files.newline_of(text) and files.lf_text(text) are the helpers.

With LF = True, Save, Save as, Git's reload of an open file and the explorer's member text all follow it. An
untitled window is written as typed.

Changes to existing modules

None breaks an import or a signature. Behaviour that differs from v0.2.0, besides the fixes above:

  • process.split_arguments(text, *, strict=False, windows=None): strict=True raises ValueError on bad
    quoting instead of splitting on spaces; windows= picks the rules regardless of the platform. The line is never
    a shell expression: no variables, globs, pipes, redirections, %VAR% or ^.
  • PaletteDialog(files, ...) takes None for files still being read and gains set_files() and list_ready.
    PaletteMixin.palette_items(commands=False) now runs in a thread: an override must not touch widgets there.
  • DesktopApp.init_desktop() returns ui.desktop.DeskTop; desktop.tile(region) with a region is unchanged.
  • ListWindow.empty_text(), EditorWindow.LF, EditorWindow.read(), EditorWindow.newline,
    SourceFile.newline are new.
  • On Windows, language servers' temporary folders move to %LOCALAPPDATA%\<app>\tmp; folders left in
    ~\.cache\<app>\tmp by v0.2.0 are not removed and can be deleted.

Verification

  • 444 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. On Windows, split_arguments is also checked against the sys.argv a child Python
    receives. The workbench's real-terminal test now types a name and Enter into Go to file as soon as it shows,
    the case that failed on a loaded CI runner (#58).
  • The consumers' suites, unchanged, against 0.2.1: divide 760 passed and turbodoo 397 passed, as with v0.2.0.
    With their workarounds removed (the integration steps below) they pass as well, and divide's tiling test fails
    on v0.2.0 without its workaround.
  • 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

  1. Dependency: turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.2.1 (and [i18n] in dev).
  2. Replaces: nothing new; the workarounds for #56, #59 and #60 can go.
  3. Changes possible, each optional:
    • src/divide/run/script.py: split_args becomes turboframe.process.split_arguments (same fallback on bad quoting);
    • src/divide/app.py: drop the _show_editor override (#60) and, under Command.TILE, call self.desktop.tile() (#59);
    • newlines: EditorWindow.LF = True instead of lf_source, saved() and ProjectTree.member_text's
      conversion. That keeps a \r\n file's newlines on save, where divide saves it with \n today; to keep
      saving \n, leave the conversion as it is.
  4. Behaviour changes to expect: Go to file opens at once on a large project and lists the files when read.
  5. Verify: divide's unit, acceptance and real-terminal suites (its Windows CI for #56 and #60), the wheel in a clean
    environment, the binary.
  6. Rollback: pin v0.2.0; the workarounds still work with it.

Integrating in turbodoo

  1. Dependency: turboframe[lsp] @ git+https://github.com/divengine/turboframe@v0.2.1.
  2. Replaces: core/dap.split_arguments, which keeps the quotes on Windows (#56), for its callers in tui/.
  3. Changes possible, each optional:
    • src/turbodoo/tui/debug.py: turboframe.process.split_arguments(text, strict=True): the same ValueError
      on bad quoting, the Windows rules fixed. core keeps the standard library only, so the function there goes
      or stays unused;
    • git_command may be chained with or instead of testing GIT_COMMANDS first;
    • newlines: EditorWindow.LF = True gives \n text and keeps \r\n on save, as turbodoo does today; the
      normalization in tui/frontend.py stays for files read outside an editor.
  4. Behaviour changes to expect: turbodoo tiles with its own region, which is used as given; nothing else.
  5. Verify: turbodoo's unit, acceptance and real-terminal suites, the wheel in a clean environment, the binary.
  6. Rollback: pin v0.2.0 (5a9e869).