Skip to content

The pyenv step fails unless the pyenv-update plugin is installed #849

@claui

Description

@claui

Erroneous Behavior

The pyenv step (introduced in #724) fails unless the optional plugin pyenv-update is installed:

── 10:00:05 - pyenv ────────────────────────────────────────────────────────────
pyenv: no such command `update'
pyenv failed:
   0: Command failed: `/home/claudia/.pyenv/bin/pyenv update`
   1: `/home/claudia/.pyenv/bin/pyenv` failed: exit status: 1

Location:
   src/steps/os/unix.rs:612
Retry? (y)es/(N)o/(s)hell/(q)uit

Expected Behavior

On installations where just pyenv is installed without the optional pyenv-update plugin, I'd expect topgrade to skip the pyenv step entirely.

As a simple method to check whether the plugin is installed, topgrade can test whether the $PYENV_ROOT/plugins/pyenv-update directory exists.

Steps to reproduce

  1. Install pyenv from GitHub without installing the pyenv-update plugin.
  2. Run topgrade --only pyenv.

Possible Cause (Optional)

The code introduced in #724 was written with the assumption that the pyenv update command was part of pyenv proper, unaware that it is really contributed by the optional pyenv-update plugin.

Problem persists without calling from topgrade

  • Yes (command line: pyenv update)
  • No

Did you run topgrade through Remote Execution

  • Yes
  • No

If yes, does the issue still occur when you run topgrade directlly in your
remote host

  • Yes
  • No

Configuration file (Optional)

Issue not related to configuration.

Additional Details

  • Operation System/Version

Affects all Linux distributions, in particular those where pyenv has been installed by cloning its GitHub repository.

  • Installation

Homebrew on Linux

  • Topgrade version (topgrade -V)

Topgrade 15.0.0

Verbose Output (topgrade -v)

Output of NO_COLOR=1 topgrade -v --only=pyenv (some directory names redacted)
DEBUG Configuration at /home/claudia/.config/topgrade.toml
DEBUG Path ~/Projects/***REDACTED*** expanded to /home/claudia/Projects/***REDACTED***
DEBUG Path ~/Projects/***REDACTED*** expanded to /home/claudia/Projects/***REDACTED***
DEBUG Loaded configuration: ConfigFile { include: None, misc: Some(Misc { pre_sudo: None, sudo_command: None, disable: Some([Containers, Gem, Helm, Pnpm, Restarts]), ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: Some(false), display_time: None, assume_yes: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, skip_notify: Some(true), bashit_branch: None, only: None, no_self_update: None, log_filters: None }), pre_commands: None, post_commands: None, commands: Some({}), python: None, composer: None, brew: None, linux: None, git: Some(Git { max_concurrency: None, arguments: Some("--rebase --autostash"), repos: ***REDACTED***, containers: None, windows: None, npm: None, yarn: None, vim: None, firmware: None, vagrant: None, flatpak: None, distrobox: None, lensfun: None }
DEBUG Version: 15.0.0
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["topgrade", "-v", "--only=pyenv"] }
DEBUG Binary path: Ok("/home/linuxbrew/.linuxbrew/Cellar/topgrade/15.0.0/bin/topgrade")
DEBUG self-update Feature Enabled: false
DEBUG Configuration: Config { opt: CommandLineArgs { edit_config: false, show_config_reference: false, run_in_tmux: false, cleanup: false, dry_run: false, no_retry: false, disable: [], only: [Pyenv], custom_commands: [], env: [], verbose: true, keep_at_end: false, skip_notify: false, yes: None, disable_predefined_git_repos: false, config: None, remote_host_limit: None, show_skipped: false, log_filter: "warn", gen_completion: None, gen_manpage: false, no_self_update: false }, config_file: ConfigFile { include: None, misc: Some(Misc { pre_sudo: None, sudo_command: None, disable: Some([Containers, Gem, Helm, Pnpm, Restarts]), ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: Some(false), display_time: None, assume_yes: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, skip_notify: Some(true), bashit_branch: None, only: None, no_self_update: None, log_filters: None }), pre_commands: None, post_commands: None, commands: Some({}), python: None, composer: None, brew: None, linux: None, git: Some(Git { max_concurrency: None, arguments: Some("--rebase --autostash"), repos: ***REDACTED***, containers: None, windows: None, npm: None, yarn: None, vim: None, firmware: None, vagrant: None, flatpak: None, distrobox: None, lensfun: None }, allowed_steps: [Pyenv] }
DEBUG Cannot find "pwsh"
DEBUG Cannot find "powershell"
DEBUG Path "/home/claudia/.config/emacs" doesn't exist
DEBUG Path "/home/claudia/.emacs.d" doesn't exist
DEBUG Cannot find "doas"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Step "pyenv"
DEBUG Detected "/home/claudia/.pyenv/bin/pyenv" as "pyenv"
―― 10:27:53 - pyenv ――
DEBUG Executing command `/home/claudia/.pyenv/bin/pyenv update`
pyenv: no such command `update'
DEBUG Command failed: Err(
   0: �[91mCommand failed: `/home/claudia/.pyenv/bin/pyenv update`�[0m
   1: �[91m`/home/claudia/.pyenv/bin/pyenv` failed: exit status: 1�[0m

Location:
   �[35msrc/steps/os/unix.rs�[0m:�[35m612�[0m)
DEBUG Step "pyenv" failed: 
   0: �[91mCommand failed: `/home/claudia/.pyenv/bin/pyenv update`�[0m
   1: �[91m`/home/claudia/.pyenv/bin/pyenv` failed: exit status: 1�[0m

Location:
   �[35msrc/steps/os/unix.rs�[0m:�[35m612�[0m
pyenv failed: 
   0: �[91mCommand failed: `/home/claudia/.pyenv/bin/pyenv update`�[0m
   1: �[91m`/home/claudia/.pyenv/bin/pyenv` failed: exit status: 1�[0m

Location:
   �[35msrc/steps/os/unix.rs�[0m:�[35m612�[0m―― 10:27:53 - Summary ――
pyenv: FAILED

/cc @lucaspar

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions