Skip to content

Clean up support scripts under SCRIPTS.md #88

Closed

Description

@tony

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

Consolidate into shared tooling

Remove shell setup once the API lands

Keep

  • The nine .exs scripts in scripts/: 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.exs and generate_schema.exs. Each is called from scaffold.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

Result

Pushed to main at 4d4b854. Every item above is done:

  • The Python and shell scripts are Elixir .exs under scripts/<name>/ with a README and ExUnit tests in CI: check_docs_links (Floki through Mix.install/2), check_example_docs, wait_for_hexdocs, check_release, check_runtime and ci_plan.
  • The six process fixtures are ExUnit tests. The BEAM cannot hold a pidfd, so a test names a process by its /proc start time and waits for that process.
  • scripts/apt-get.sh and scripts/tmux_ref.py are gone: scaffold.yml uses the shared apt-get and build-tmux actions at libtmux/.github@30f8184. The shared repository has no planner, so ci_plan stays 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 the kill calls (Add kill for session, window, pane and server (kill-*) #76) replace examples/owned_server.py and every System.cmd start. Each example starts and stops its own server.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions