Skip to content

pyenv-do: add as an alias to PYENV_VERSION=<version> pyenv exec - #3639

Merged
native-api merged 1 commit into
pyenv:masterfrom
macayu17:feat/pyenv-do
Nov 17, 2026
Merged

native-api merged 1 commit into
pyenv:masterfrom
macayu17:feat/pyenv-do

Conversation

@macayu17

@macayu17 macayu17 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Prerequisite

Description

  • Here are some details about my PR

Adds pyenv do <version> <command> [args...]. It just sets PYENV_VERSION and runs pyenv exec, so child processes that go through shims get the same version and the selected version stays as is.

Documented as an alias to PYENV_VERSION=<version> pyenv exec in the help text and COMMANDS.md, like suggested in the issue.

Completion gives system and the installed versions for the first argument, then the same as pyenv exec.

Tests

  • My PR adds the following unit tests (if any)

Added test/do.bats with tests for usage, running a command with the given version, and completion. Full test suite passes in the Docker test images on bash 3.2.57 and 4.1.17, with and without GNU tools.


Summary by cubic

Adds a new pyenv do subcommand for running a command with a specified Python version without changing the currently selected one. It sets PYENV_VERSION and delegates to pyenv exec, so the version applies only to that command invocation.

New Features

  • pyenv do <version> <command> [args...] is an alias to PYENV_VERSION=<version> pyenv exec, documented in the help text and COMMANDS.md.
  • Completion returns system and installed versions, then the same completions as pyenv exec.
  • Adds unit tests covering usage, version selection, and completion.
  • Closes pyenv do as an easier alternative to PYENV_VERSION= pyenv exec #1932.

Written for commit 3c2b1c5. Summary will update on new commits.

View guided diff

@macayu17
macayu17 requested review from a team as code owners November 16, 2026 15:32
Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Re-trigger cubic

@native-api
native-api merged commit de5e15e into pyenv:master Nov 17, 2026
26 checks passed
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.

pyenv do as an easier alternative to PYENV_VERSION= pyenv exec

3 participants