Skip to content

Create virtualenv inside envs directory as similar as Anaconda #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 5, 2015

Conversation

yyuu
Copy link
Collaborator

@yyuu yyuu commented Nov 4, 2015

This changes the installation path of virtualenv as similar as Anaconda/Miniconda. This would be reasonable since every virtualenvs are actually depending on its source version, and they cannot work alone.

This is a kind of breaking change. To mitigate the migration cost, I prepared a symlink of COMPAT_VIRTUALENV_PATH for backward compatibility.

VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}"
VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VERSION_NAME}/envs/${VIRTUALENV_NAME}"

COMPAT_VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}" # TODO: create symlink?
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO: create symlink?

👍

Also two symlinks or only env-${VIRTUALENV_NAME} would be nice (regarding the namespace/sorting aspect).

Edit: done below (https://github.com/yyuu/pyenv-virtualenv/pull/107/files#diff-bd69978b5a6129153b41981ec977a3d5R436) already, so the TODO seems obsolete.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The var should be prefixed with PYENV_.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally, I prefer simple naming of ${VIRTUALENV_NAME} than env-${VIRTUALENV_NAME}. It would be better from the point of view of backward compatibility. I think naming of the virtualenv would be a matter of users, and tool should not do mangling as much as possible....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

COMPAT_VIRTUALENV_PATH is a shell variable, not an environment variable. So, we don't have to be severe about naming convention, I believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The TODO message was just lying.... I'll remove it.

@blueyed
Copy link
Collaborator

blueyed commented Nov 5, 2015

Nice!

yyuu added a commit that referenced this pull request Nov 5, 2015
Create virtualenv inside `envs` directory as similar as Anaconda
@yyuu yyuu merged commit 5c9909f into master Nov 5, 2015
@yyuu yyuu deleted the create-virtualenv-in-envs branch November 5, 2015 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants