Commit graph

1105 commits

Author SHA1 Message Date
980ee7071c Replace killpg-on-self with thread-scoped subprocess kill on quit
Removes the shell's "Killed" message and lets fill3's terminal-restore
codes flush via normal interpreter exit. Worker.kill() now SIGKILLs only
the worker thread's subprocess descendants (via /proc/PID/task/TID/children,
recursing through shell=True grandchildren), so editor and xdg-open spawns
from the main thread survive quit. A _killed flag skips persisting result
pickles for aborted tool runs. start_new_session=True is no longer needed
on editor/xdg-open launches since the kill is worker-thread-scoped.
2026-08-04 08:31:28 +10:00
b932ebc6b8 Add test asserting free-threading survives full module import
Verify the interpreter is free-threaded (Py_GIL_DISABLED) and the GIL is
not re-enabled after loading the full eris module chain, so a dependency
that re-enables the GIL (PEP 703) or a non-free-threaded interpreter
fails the suite.
2026-08-03 18:47:46 +10:00
b96a8669cf Pin free-threaded Python explicitly in .python-version
A bare 3.14 previously resolved to the freethreaded build only because it
was the sole final 3.14 in uv's managed cache. Use 3.14t to lock in
free-threading against future plain 3.14 installs.
2026-08-03 12:57:23 +10:00
8af627b502 Save full summary on quit regardless of cursor row
__getstate__ emitted an empty entry list whenever the cursor was on the
top row (y == 0), so quitting from the top silently discarded all
previously calculated results. The guard was intended to rotate the
cursor row to the front, but the y == 0 case should simply keep the whole
list as-is. Remove the guard so all entries are always persisted.
2026-08-03 12:45:59 +10:00
53474b2bcb Flush stdout before killpg so terminal restore codes survive
sys.stdout is line-buffered on a tty, and fill3's terminal restore
context managers (alternate_buffer, mouse_tracking, title) only write
escape sequences without newlines. killpg(SIGKILL) killed the process
before those buffered codes were flushed, leaving the terminal stuck
in the alternate buffer with mouse tracking on. Flush first.
2026-08-03 11:10:33 +10:00
36a07813e7 Fix --version and make killpg fire under uv run
--version printed a stale __version__ (2026.7.28); bump it to 2026.8.3
and update the README install tag.

The killpg-on-self guard required eris to be its own process-group
leader, which is false under 'uv run eris' (uv is the leader), so the
fast shutdown never triggered. Also accept getpgrp() == getppid(),
covering the uv-run case while non-tty runs still skip killpg.
2026-08-03 10:44:53 +10:00
87813fdf21 Kill in-flight tools instantly on quit via killpg(self)
When eris quits, _python_exit joins executor threads, which block on
in-flight subprocess.run calls for up to TIMEOUT seconds. After saving
state, kill the process group to reap all tool subprocesses instantly.
Isolate editor/xdg-open in their own sessions so they survive.
2026-08-03 10:27:38 +10:00
eebb226b21 Use worker threads instead of subprocesses, bump to 2026.8.3
Convert each Worker from a subprocess to a thread running the tool in a
ThreadPoolExecutor, so eris can run free-threaded under CPython 3.14t.
Bump fill3 and lscolors deps to 2026.8.3 for the GIL-free cwcwidth chain.
2026-08-03 09:46:44 +10:00
527d2acd23 tools: Removed pydoc test
- pydoc output contains absolute paths
2026-08-01 09:03:46 +10:00
78246d51d1 use str.removeprefix/removesuffix for string slicing 2026-07-31 22:50:31 +10:00
bf42d15a4b simplify _image_to_text using itertools.batched
Pair image rows directly from the flattened pixel stream in blocks of
width*2, dropping the intermediate rows list and the range(0, height, 2)
indexing.
2026-07-31 22:35:13 +10:00
ced2895fbc raise requires-python to >=3.14
Align the minimum Python version with .python-version, the Dockerfiles,
and the cp314 wheels the build produces, since itertools.batched
(python 3.12+) is now used in paged_list.
2026-07-31 22:20:50 +10:00
7b82b8298d use itertools.batched in paged_list batch()
Replace the groupby-based pure-Python batching with the C-implemented
itertools.batched (Python 3.12+), wrapped in map(list, ...) to preserve
list-typed pages.
2026-07-31 22:14:15 +10:00
6a39f1aa3c coding style: Remove traces of snap builds 2026-07-31 21:56:50 +10:00
bcb1a0105b Update TODO
- Am currently self hosting not publishing on PyPI
2026-07-31 21:21:02 +10:00
b52bd59eb6 Using standard pytest for testing 2026-07-31 21:18:59 +10:00
1ac0ef3dae packaging: Don't need to run eris inside docker 2026-07-31 21:14:24 +10:00
feb0d0a68c revert worker to subprocess model, self-spawning via --worker flag
ProcessPoolExecutor relied on private API, lost os.setpriority and
auto-restart. Revert to the subprocess worker but spawn the current
executable with --worker instead of a separate eris-worker console
script, keeping a single entry point for shiv/pyinstaller. Bump
.python-version to 3.14.
2026-07-31 19:30:40 +10:00
2b13609966 add PyInstaller build script 2026-07-30 23:57:49 +10:00
cfc6e2d176 Relax requires-python to >=3.11, set .python-version to 3.13 2026-07-30 23:31:02 +10:00
272b28c46c revert Alpine Dockerfile to source-build for musl compatibility; restore uv-based Debian Dockerfile for Python 3.14 2026-07-30 13:01:52 +10:00
e35e2aefd5 simplify Dockerfiles to use pre-built dist/eris instead of uv build
Remove all build-dependency packages (glfw-dev, cmake, git, python3-dev,
libX11, mesa, etc.) that were only needed for building eris's Python deps
from source. Replace uv + source install with COPY dist/eris. Use
python3 /usr/local/bin/eris for ENTRYPOINT to avoid shebang portability
issues.
2026-07-30 12:24:32 +10:00
daba0d3eb4 add Shiv-based build for standalone eris executable
- Add 'shiv' to dev dependencies in pyproject.toml
- Add dist/ to .gitignore
- Create packaging/build-shiv script: builds dist/eris zipapp via
  shiv -e eris.__main__:entry_point --compile-pyc --reproducible
- Update uv.lock
2026-07-30 12:06:57 +10:00
1f72a3cbc7 revert pydoc to TOML-defined subprocess tool, remove @in_separate_process
Replace the native pydoc() function (+ @in_separate_process, _call_in_process)
with a TOML tool definition running python3 -m pydoc directly. No ANSI
styling, no TermDoc, no process isolation decorator. This eliminates the
grandchild worker process (from nested ProcessPoolExecutor) that caused
TUI corruption on shutdown.

Also remove now-unused import concurrent.futures from tools.py.
Regenerate the pydoc golden file to match plain-text output.
2026-07-30 11:35:12 +10:00
ed6457a0f0 replace eris-worker subprocess with ProcessPoolExecutor; guard sweep generators against empty _entries
- Rewrite worker.py: each Worker uses a ProcessPoolExecutor(max_workers=1),
  tools run via loop.run_in_executor() in a forked OS subprocess
- Remove create_process(), main(), stdin/stdout IPC, os.killpg
- Remove eris-worker entry point from [project.scripts] in pyproject.toml
- Update tests/worker_test.py for new Worker API
- Guard _sweep_up/_sweep_down against IndexError when _entries is empty;
  keep cursor_position() try/except for stale y after row deletion
2026-07-30 11:35:12 +10:00
3925ded957 refactor pydoc: inline into tools.py with @in_separate_process decorator for subprocess isolation 2026-07-30 11:34:30 +10:00
7e758b4da5 fix package names for Fedora 44 and Arch; pin Dockerfile base images to current distro releases 2026-07-30 11:34:30 +10:00
c6a076c31d fix Dockerfiles: add C++/make for glfw-sys source build; fix Alpine package names; fix EOL base images 2026-07-29 22:08:16 +10:00
e88385c861 add GLFW source build dependencies to all Dockerfiles 2026-07-29 12:48:23 +10:00
458e334f5d regenerate uv.lock after lscolors dep fix (termstr inline git+ tag) 2026-07-29 09:21:01 +10:00
ef41f35812 fix Dockerfiles: add git, fix path to ./eris 2026-07-29 08:58:09 +10:00
6ffab2828a update Dockerfiles: replace pipx with uv tool install --python 3.14 2026-07-29 08:49:34 +10:00
4f527b2ddb bump fill3 dep to 2026.7.28 (textgrid-rust pyo3 0.23→0.24 for python 3.14) 2026-07-28 13:37:28 +10:00
9be41ce792 convert indented code blocks to fenced for copy-to-clipboard 2026-07-28 12:22:24 +10:00
3da95703a1 bump version to 2026.7.28 2026-07-28 12:17:00 +10:00
92cd41c152 packaging: Fix README 2026-07-28 12:10:29 +10:00
fe5640f9aa packaging: Drop pipx as an installation method 2026-07-28 12:06:56 +10:00
5b1269ce1d add --python 3.14 to uv tool install command in README and make-readme.py 2026-07-28 11:51:03 +10:00
b72de1d2e6 add .python-version for uv python 3.14 auto-download 2026-07-28 11:36:21 +10:00
e578b3cd5d bump pillow 11.3.0→12.3.0, pygments 2.19.1→2.20.0 2026-07-28 11:32:32 +10:00
05ed8437eb fix pillow 3.14 wheel support, fix extra-build-variables format 2026-07-28 11:25:30 +10:00
d22ae3c268 bump minimum python to 3.14, drop shebangs 2026-07-28 11:15:16 +10:00
659b1f891a packaging: Remove appimage 2026-07-28 11:09:53 +10:00
f734dba3f1 packaging: Remove snap 2026-07-28 11:09:53 +10:00
22a23eea7c Fix DeprecationWarning: asyncio.get_event_loop -> new_event_loop 2026-07-28 10:33:38 +10:00
2c5d7eb853 Accept updated golden files (log, window-orientation) 2026-07-28 10:30:42 +10:00
c906966ce8 Remove MainTestCase (incompatible with pytest) and unused imports 2026-07-28 10:26:59 +10:00
a3f8643c27 Add conftest.py for --diff/--accept pytest options 2026-07-28 10:18:09 +10:00
922ec123a9 Add pytest dev dep, ignore golden-files in test discovery, remove stale dirs 2026-07-28 10:02:29 +10:00
b50685c19c Inline git deps in pyproject.toml (remove tool.uv.sources) 2026-07-28 09:47:32 +10:00