Skip to content

Conversation

native-api
Copy link
Member

This is only meant to be an example. There's a lot of simplification that works because my usage of Pyenv is simple.

Make sure you have checked all steps below.

Prerequisite

  • Please consider implementing the feature as a hook script or plugin as a first step.
    • pyenv has some powerful support for plugins and hook scripts. Please refer to Authoring plugins for details and try to implement it as a plugin if possible.
  • Please consider contributing the patch upstream to rbenv, since we have borrowed most of the code from that project.
    • We occasionally import the changes from rbenv. In general, you can expect changes made in rbenv will be imported to pyenv too, eventually.
    • Generally speaking, we prefer not to make changes in the core in order to keep compatibility with rbenv.
  • My PR addresses the following pyenv issue (if any)

Description

  • Here are some details about my PR

#2918 (comment)

Tests

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

This is only meant to be an example. There's a lot of simplification
that works because my usage of Pyenv is simple.
@ryukinix
Copy link

Very interesting

@native-api
Copy link
Member Author

#2918 (comment)

I've created #3037 from @varikin's changes -- and as the CI shows, they clearly need more adjustments as they are currently breaking even the builds.

Anyone interested can create either a new PR, or a PR to that PR (by specifying the PR branch as the base branch for a new PR; it will be created in @varikin's fork).

ChristianFredrikJohnsen added a commit to ChristianFredrikJohnsen/pyenv that referenced this pull request Dec 25, 2024
…t installed.

I was doing some debugging with PYENV_DEBUG=1 and noticed that a lot of
work was being done in conda.bash, even though I had not installed any
conda versions like `mambaforge`.

The solution is pretty simple, put all the code inside an if-block.
This aligns with what @varikin found in his pull request pyenv#3037

Additionally, I have refactored the code slightly for readability
(created function `build_conda_exclusion_list`), and added comments
which should make it easier to understand what's going on.

This commit simplifies debugging and should reduce the execution time of

```bash
eval "$(pyenv init -)"
```

slightly.
native-api pushed a commit to ChristianFredrikJohnsen/pyenv that referenced this pull request Feb 13, 2025
…t installed.

I was doing some debugging with PYENV_DEBUG=1 and noticed that a lot of
work was being done in conda.bash, even though I had not installed any
conda versions like `mambaforge`.

The solution is pretty simple, put all the code inside an if-block.
This aligns with what @varikin found in his pull request pyenv#3037

Additionally, I have refactored the code slightly for readability
(created function `build_conda_exclusion_list`), and added comments
which should make it easier to understand what's going on.

This commit simplifies debugging and should reduce the execution time of

```bash
eval "$(pyenv init -)"
```

slightly.
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 init slows down the shell startup a bunch (by about ~100 ms!)

3 participants