Skip to content

feat: let Command.copy() duplicate a command without argument - #22

Merged
amannocci merged 4 commits into
mainfrom
feat/copy-without-argument
Nov 27, 2026
Merged

amannocci merged 4 commits into
mainfrom
feat/copy-without-argument

Conversation

@amannocci

Copy link
Copy Markdown
Member

🧑‍💻What is the change being made?

  • Command.copy() without argument returns an independent command running the same binary with the same settings, without looking the binary up on PATH again. copy(other) is unchanged. Bind._command uses it.
  • Docs: the home page install box gets one tab per package manager (pip, uv, Poetry, PDM, pipenv), listed on the getting started page and in the README too.
  • Docs: the asyncio guide is renamed "Async execution" in the sidebar and title (path and anchors unchanged).
  • Docs: the async guide and concurrency recipe build ssh once and run a copy() per host.

❓ Why is the change being made?

Reusing a base configuration required Command("git").copy(base), which repeats the binary name and its lookup. base.copy() is shorter and resolves the binary once, which matters when fanning out many commands.

✅ How has this been tested?

  • New tests: the duplicate carries the settings and stays independent from the source; copy() still works after PATH is emptied.
  • uv run poe lint and uv run poe test (233 passed); vitepress build passes.

📚 How has this been documented?

copy() docstring, the "Reuse a configuration" guide section and a CHANGELOG.md entry under Unreleased.

🔗 Related Issues

None.

copy() with no argument returns an independent command running the same
binary with the same settings, without looking the binary up again.
copy(other) keeps copying another command's settings into this one.
The home page install box gets one tab per package manager, the getting
started page and the README list the same commands.
Match the other guide titles, which name a topic rather than a module.
The page path and its section anchors stay, so existing links still work.
Build the ssh command once and give each host its own copy() of it,
instead of looking the binary up on PATH for every host.
@amannocci amannocci self-assigned this Nov 27, 2026
@amannocci
amannocci merged commit 922b38d into main Nov 27, 2026
16 checks passed
@amannocci
amannocci deleted the feat/copy-without-argument branch November 27, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant