Repository navigation
Description
Summary
The Elixir port has no parity scripts and no uncalled scripts. Of its 20 shell and Python files, 7 consolidate into shared tmux tooling, 12 port to Elixir, and 1 (examples/owned_server.py) goes when the library can start and stop a server. The nine existing .exs scripts stay.
Motivation
.github/SCRIPTS.md says scripts in this repository are Elixir, run with mix run or elixir, that tooling shared by several ports lives once, and that a capability Elixir lacks comes from a test-only Elixir dependency, not a second language. The decision behind it is libtmux/docs#323. An audit found no import libtmux, tmux-python or pip install use. The shell and Python that start tmux for examples are tracked in #85, #82 and #76, so no new missing-API issue is needed.
Tasks
Port to Elixir
-
scripts/check_docs_links.py: parses rendered HTML and checks links. Called byscaffold.yml,release.ymland CONTRIBUTING. Use a test-only HTML parser dependency. -
scripts/check_example_docs.py: checks that the docs display the executable examples. It is about 30 lines overPathand a regex, so it fits beside the other.exschecks. Called byscaffold.ymland CONTRIBUTING. -
scripts/wait_for_hexdocs.shandtest/hexdocs_readiness_test.py: wait for the published HexDocs page, and the outer test that drives it against a local HTTP server. Called byrelease.ymlandscaffold.yml. -
test/ci_changelog_test.pyandtest/ci_runtime_test.py: exercisescripts/check_release.exsandscripts/check_runtime.exs. Rewrite them as ExUnit tests. Called byscaffold.yml. - The six process fixtures in
test/support/:control_exit.py,io_contract.py,io_faults.py,io_vm_death.py,quickstart_stop.pyandsplit_argv_lifetime.py. They observe tmux clients and helper processes through pidfds. Callers arenative_ownership_test.exs,control_receive_integration_test.exs,quickstart_example_integration_test.exsandscripts/check_examples.exs. Port them to Elixir, with pidfd and PTY support from a test-only Elixir dependency if the BEAM lacks it.
Consolidate into shared tooling
-
scripts/apt-get.sh: a byte-identical copy of the script that many ports vendor. Called byscaffold.yml. -
scripts/ci_plan.pyandtest/ci_plan_test.py: the tmux matrix planner that readspriv/tmux/support.json. Called byscaffold.ymland CONTRIBUTING. -
scripts/tmux_ref.py,test/ci_tmux_ref_test.pyand the inline tmux build inscaffold.yml: resolve a tmux ref to a commit and build it. Replace them with the shared tmux build workflow or action. -
test/ci_docs_test.pyandtest/ci_workflow_test.py: both importci_planto compare the docs andscaffold.ymlwith the manifest. Move them with the planner, or rewrite them in Elixir against the shared manifest.
Remove shell setup once the API lands
-
examples/owned_server.py: the Python launcher behind everypython3 examples/owned_server.py --runline in the README and guides, and the host for the test fixtures intest/support/owned_tmux.exandscripts/check_examples.exs. Delete it when a server start and stop call lands in Add a call to start and stop a private tmux server #82. Elixir examples start tmux with System.cmd and python3 #85 tracks the matchingSystem.cmdstart inexamples/quickstart.exsanddocs/standalone-demo.md, and Add kill for session, window, pane and server (kill-*) #76 tracks thekill-servercall that both end with.
Keep
- The nine
.exsscripts inscripts/:check_consumer_types.exs,check_examples.exs,check_hex_install.exs,check_package.exs,check_public_contracts.exs,check_public_types.exs,check_release.exs,check_runtime.exsandgenerate_schema.exs. Each is called fromscaffold.yml,release.yml, CONTRIBUTING or another kept script.
Acceptance
No shell or Python script file remains. This prints nothing:
$ git ls-files '*.py' '*.sh'Nothing starts Python or a shell script. This prints nothing:
$ rg -l 'python3|\.py\b|\.sh\b' .github/workflows README.md docs examples scripts test lib --glob '!.github/SCRIPTS.md'No Python libtmux or tmuxp dependency exists. This prints nothing outside attribution:
$ rg -l 'import libtmux|tmux-python/libtmux|pip install (libtmux|tmuxp)'CI runs the tests of every ported script and no longer vendors apt-get.sh, ci_plan.py or tmux_ref.py.
References
.github/SCRIPTS.md- libtmux/docs#323
- Elixir examples start tmux with System.cmd and python3 #85: examples start tmux with
System.cmdandpython3 - Add a call to start and stop a private tmux server #82: start and stop a private tmux server
- Add kill for session, window, pane and server (
kill-*) #76:kill-*calls
Result
Pushed to main at 4d4b854. Every item above is done:
- The Python and shell scripts are Elixir
.exsunderscripts/<name>/with a README and ExUnit tests in CI:check_docs_links(Floki throughMix.install/2),check_example_docs,wait_for_hexdocs,check_release,check_runtimeandci_plan. - The six process fixtures are ExUnit tests. The BEAM cannot hold a pidfd, so a test names a process by its
/procstart time and waits for that process. scripts/apt-get.shandscripts/tmux_ref.pyare gone:scaffold.ymluses the sharedapt-getandbuild-tmuxactions atlibtmux/.github@30f8184. The shared repository has no planner, soci_planstays here, in Elixir, and the plan job installs Elixir.Server.start/1,Server.stop/2,Server.with_owned/2(Add a call to start and stop a private tmux server #82, Elixir examples start tmux with System.cmd and python3 #85) and thekillcalls (Add kill for session, window, pane and server (kill-*) #76) replaceexamples/owned_server.pyand everySystem.cmdstart. Each example starts and stops its own server.
Activity