Commit graph

138 commits

Author SHA1 Message Date
19dbb2fd02 Redirect SummaryCursorTest cache writes to a temp dir
The getstate test called Summary.__getstate__(), which rebuilt the
PagedList pages in tools.CACHE_PATH/summary_dir with exist_ok=True.
Since CACHE_PATH is relative to the current directory, running the
tests clobbered the real .eris cache and caused eris to crash on the
next startup when sync_with_filesystem hit the stale summary.
2026-08-05 09:18:56 +10:00
33b08d3a09 Support zstd compression via the Python 3.14 compression module
Map --compression values to the compression package submodules so zstd
is available alongside gzip, lzma and bz2. Default remains gzip.
2026-08-04 21:21:12 +10:00
329f500c8e Refuse to run a second eris instance on the same directory
flock on .eris/lock prevents two eris processes racing the cache, which
previously produced a mixed-format summary (int-list pages) and crashed
sync_with_filesystem. The lock is acquired before manage_cache, the lock
file survives checksum-mismatch cleanup, and the holder's PID is written
to the lock file so a refused instance can report it.
2026-08-04 09:25:49 +10:00
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
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
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
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
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
d22ae3c268 bump minimum python to 3.14, drop shebangs 2026-07-28 11:15:16 +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
2b5b7f7fe9 tools: Drop fragile golden tests that work on x86 but not arm 2025-06-09 18:18:52 +10:00
410666e0b0 tools: Get tools tests passing
- 7zz is now 7z
- Update golden files for different shade of grey
2025-06-09 18:12:47 +10:00
fe5389d698 packaging: Try using uv workspaces. 2024-12-28 17:29:38 +10:00
b4b237ec1f Move tests into their projects. 2021-11-04 23:04:41 +10:00
09ec5fb009 Coding Style.
- Remove unnecessary 'from import'.
2021-11-03 22:29:57 +10:00
0f59e43395 Removed failing golden tests.
- Some tests weren't position independant, and were only working
  for me.
- Don't need to keep these, not all tools have integration tests.
2021-11-03 14:39:40 +10:00
a74633e087 Coding Style.
- Move terminal.py from termstr package to fill3 package.
- Terminal was no longer used by termstr.
- Terminal could be in its own package in future.
2021-11-03 14:26:07 +10:00
c2b7a8ce64 Coding Style.
- Allow 'import termstr' instead of 'import termstr.termstr'.
2021-11-03 14:13:04 +10:00
c181ab9de9 Coding style.
- Remove all dead code from tests.
2021-10-31 22:22:52 +10:00
2335dec922 Coding style.
- Break out termstr, fill3, sorted_collection and lscolors into
  seperate packages and modules.
2021-10-31 02:21:09 +10:00
7415b2af7d Add missing golden file. 2021-10-19 17:48:41 +10:00
d83bea2ba8 release: Move eris to ubuntu 21.10.
- Update readme.
- php7 -> php8.
- Fix python-coverage.
- Also need python decorator module.
- Replaced Mcrt1 with rotatingtree since Mcrt1 started raising
  a new warning.
2021-10-18 01:40:39 +10:00
42bf4d2582 Rename 'xdg-open' action to 'open'.
- Debian is renaming xdg-open to open.
- Rename 'orient' to 'turn'.
2021-09-23 23:17:04 +10:00
a963dd7377 Make running status color stand out.
- Lime stands out better than blue on a green background.
2021-08-11 14:25:37 +10:00
c91beda9b4 Display wide characters correctly.
- Made termstr's length match the on-screen width.
  - Achieved by adding a zero width character after each wide
    character.
  - This fixes ljust and rjust, so that there is correct padding,
    otherwise Portal appearances aren't the correct width.
- When getting a sub-string containing half a wide character,
  the half character is a space.
- Some wide characters are still broken. e.g. country flags
2021-07-25 23:07:12 +10:00
c4fb3fdfe3 tools: Stop initial blank lines being stripped. 2021-07-25 01:51:40 +10:00
4197cebd1b Combine normal and okay statuses.
- Changed all normal results to ok.
- Normal results were intended for tools that produced info and
  weren't expected to have problem results.
  - Ultimately not worth distinguishing from tools that sometimes
    show problems.
- One less color status makes the summary table simpler.
- Also changed the not-applicable status color to the lighter grey
  that normal used to have.
- Made the success status non-configurable since ok status is the
  only sensible status at the moment.
2021-07-20 01:59:46 +10:00
1d3e44f7ad Can also quit with the escape key.
- Also removed unnecessary color from the help docs.
2021-06-06 00:20:42 +10:00
7ef9cf02d1 release: Keep golden file up to date.
- The mime type of python scripts changed.
2021-05-19 02:14:10 +10:00
3e7d306273 release: Use ubuntu golang for godoc and go vet.
- The github versions weren't installing anymore.
2021-05-19 02:14:10 +10:00
5d553a6542 release: Move to python3.9 2021-05-19 02:14:10 +10:00
2b0fd6b724 Make the placeholder dots darker.
- Makes the white cursor stand out.
2021-05-19 02:14:10 +10:00
77ce5c68b0 Make the summary pane narrower and listing pane wider.
- In portrait mode.
- In the average project there was a bit of wasted space.
  Python files (with lots of statuses) in a subdirectory had
  space left over. They can still be seen with the summary
  pane narrowed.
- Puts emphasis on viewing the listing over the summary pane.
- Contents were often a little too wide for the listing pane
  and now fit.
2021-05-19 02:14:10 +10:00
2da603c5bf Coding style.
- Incorporate gut into tools.
- Remove gut tests which were only useful for developing the old
  implementation.
2021-05-07 21:07:45 +10:00
d471934946 tools: Make python_gut more correct.
- Using the ast module to correctly determine the line numbers
  of the function bodies.
- Should have done it this way in the beginning, but didn't know
  about ast module tracking line numbers.
- No more heuristics.
- Copes with different size indentations.
2021-05-07 19:58:41 +10:00
787c304d06 Files don't need individual license headers.
- All files are licensed by the LICENSE file at root.
- Updated the license to 2021.
- Have kept the license in LS_COLORS since its 3rd party.
2021-04-12 02:25:49 +10:00
445f3ad745 tools: Remove golden file tests for perldoc.
- perldoc output is dependant on the terminal.
  - Don't need golden files for everything.
2020-10-15 13:22:39 +10:00
0cdb5c3a37 More robust parsing of ascii term codes. 2020-10-15 12:17:02 +10:00
bea859f54f Fix broken tests. 2020-10-12 22:45:34 +10:00
7058967134 Update golden file of perldoc output. 2020-10-12 22:29:37 +10:00
c20f5bbb36 Fix missed update of golden file. 2020-05-04 02:15:51 +10:00
4511128c9f Coding style.
- Use new 'cached_property' in python3.8.
2020-04-30 00:35:44 +10:00
310451ae4d Remove log file.
- It was really only for debugging.
- The log would be redundant when eris outputs the log, when run
  without a tty.
2020-04-25 15:18:43 +10:00