Skip to content
TheChatArchiveThe Chat Archive
Metallama-3.3-70b-instruct· MetaHugging Face LMArena Human Preference 140K

How do I add a dependency to a group like dev using uv add?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    How do I add a dependency to a group like dev using uv add?

  2. Meta Assistant

    To add a dependency to a specific group, such as the "dev" group, using uv add, you would typically use the following syntax:

    uv add <package-name> --group=dev
    

    Replace <package-name> with the name of the package you wish to add. This command tells uv to add the specified package as a dependency, specifically to the "dev" group, which usually denotes development dependencies that are not required for the production environment.

    If you're using a package manager like npm or yarn under the hood (which uv might be an alias for, or working in conjunction with), the exact command might slightly differ. For instance, with npm, you would use:

    npm install <package-name> --save-dev
    

    And with yarn, you would use:

    yarn add <package-name> --dev
    

    Both of these commands add the package to your project's development dependencies.

    Please note, the exact syntax can depend on the package manager you're actually using (npm, yarn, pip, etc.) and how uv is configured or aliased in your environment. If uv is a custom or less common package manager, you might need to refer to its specific documentation for the correct syntax.

  3. User

    And how do I add a package to one of my extras using uv add?

  4. Meta Assistant

    To add a package to one of your extras using uv add, you would typically use the following syntax:

    uv add <package-name> --extras=<extra-name>
    

    Replace <package-name> with the name of the package you wish to add, and <extra-name> with the name of the extra you want to add it to.

    For example, if you have an extra named "testing" and you want to add the "pytest" package to it, you would use:

    uv add pytest --extras=testing
    

    This command tells uv to add the "pytest" package as a dependency, specifically to the "testing" extra.

    Note that the exact syntax might vary depending on the package manager you're using under the hood, but the above syntax should work for most cases. If you're using a different package manager like pip (which supports extras), the syntax would be similar:

    pip install <package-name>[<extra-name>]
    

    For instance:

    pip install pytest[testing]
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.