Repository navigation
pyenv-do: add as an alias to PYENV_VERSION=<version> pyenv exec - #3639
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite
pyenv doas an easier alternative toPYENV_VERSION= pyenv exec#1932.pyenv doas an easier alternative toPYENV_VERSION= pyenv exec#1932Description
Adds
pyenv do <version> <command> [args...]. It just setsPYENV_VERSIONand runspyenv 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 execin the help text and COMMANDS.md, like suggested in the issue.Completion gives
systemand the installed versions for the first argument, then the same aspyenv exec.Tests
Added
test/do.batswith 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 dosubcommand for running a command with a specified Python version without changing the currently selected one. It setsPYENV_VERSIONand delegates topyenv exec, so the version applies only to that command invocation.New Features
pyenv do <version> <command> [args...]is an alias toPYENV_VERSION=<version> pyenv exec, documented in the help text andCOMMANDS.md.systemand installed versions, then the same completions aspyenv exec.pyenv doas an easier alternative toPYENV_VERSION= pyenv exec#1932.Written for commit 3c2b1c5. Summary will update on new commits.