uv icon indicating copy to clipboard operation
uv copied to clipboard

Prompt activation after uv venv has successfully run

Open 0v00 opened this issue 1 year ago • 0 comments

Summary

If the platform os matches Os::Windows then we provide the following prompt:

writeln!(
   printer,
   "Activate with .\\{}\\Scripts\\activate.ps1",
   path.normalized_display().cyan()
)

Otherwise we provide the following prompt:

writeln!(
  printer,
  "Activate with source {}/bin/activate",
  path.normalized_display().cyan()
)

I've added additional filters in crates/uv/tests/venv.rs so there shouldn't be issues on any of the CI runs (not sure what some of the Windows paths could look like, so these filters might need to be changed):

        (
            r".*?\\\.venv\\Scripts\\activate\.ps1", 
            "Activate with source /home/ferris/project/.venv/bin/activate"
        )

Test Plan

  • Ran tests in crates/uv/tests/venv.rs and updated snapshots.
  • Ran uv venv in a Docker container to test that the output is correct (running Ubuntu)

0v00 avatar Feb 17 '24 10:02 0v00