Skip to content
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

uv venv does not suggest how to activate #1326

Closed
zanieb opened this issue Feb 15, 2024 · 4 comments · Fixed by #1580
Closed

uv venv does not suggest how to activate #1326

zanieb opened this issue Feb 15, 2024 · 4 comments · Fixed by #1580
Labels
enhancement New feature or improvement to existing functionality virtualenv Related to virtual environments

Comments

@zanieb
Copy link
Member

zanieb commented Feb 15, 2024

❯ uv venv
Using Python 3.11.7 interpreter at /opt/homebrew/opt/python@3.11/bin/python3.11
Creating virtualenv at: .venv

❯ source .venv/bin/activate

We should prompt activation

@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Feb 15, 2024
@zanieb
Copy link
Member Author

zanieb commented Feb 15, 2024

python -m venv is silent; virtualenv is verbose but not helpful

❯ virtualenv foo
created virtual environment CPython3.12.0.final.0-64 in 250ms
  creator CPython3Posix(dest=/Users/mz/eng/src/astral-sh/uv/foo, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, via=copy, app_data_dir=/Users/mz/Library/Application Support/virtualenv)
    added seed packages: pip==23.3.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

@0v00
Copy link
Contributor

0v00 commented Feb 16, 2024

@zanieb For prompting activation, would it be sufficient to add the following to crates/uv/src/commands/venv.rs inside of venv_impl?

    writeln!(
        printer,
        "Activate virtualenv: source {}/bin/activate",
        path.normalized_display().cyan()
    )
    .into_diagnostic()?;

Happy to make a small PR/update tests if so.

@zanieb
Copy link
Member Author

zanieb commented Feb 16, 2024

I think so! Maybe styled like "Activate with source ...."?

@zanieb
Copy link
Member Author

zanieb commented Feb 16, 2024

Note we also need a separate hint to Windows users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality virtualenv Related to virtual environments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants