Skip to content

Allow uv venv to throw error instead of prompting #15475

@notatallshaw

Description

@notatallshaw

Summary

I often use imperative commands as part of a script, e.g. uv pip, uv venv.

I therefore want them to fail with a non-zero status code when they can't complete an action.

But it appears uv venv only has two options when the directory it's writing to is non-empty:

  • Automatically delete everything in the directory,
  • Prompt for user interaction.

But I want uv venv to fail without user prompt, is that currently possible? I don't see an option.

Example

cd /
uv venv .

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionalitygood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions