Skip to content

Documentation error in CONTRIBUTING.md: incorrect uv command for installing dev dependencies #20

@HaohanTsao

Description

@HaohanTsao

Issue Description

I met an error in the CONTRIBUTING.md and README.md file regarding the command to install development dependencies using uv. The current instructions suggest using uv add -e ".[dev]", but this command fails with an error because uv add does not support the -e flag for editable installs.

Steps to Reproduce

  1. Clone the repository

    git clone https://github.com/tadata-org/fastapi_mcp.git
    cd fastapi-mcp
  2. Create a virtual environment with uv

    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Try to install development dependencies following the instructions in CONTRIBUTING.md

    uv add -e ".[dev]"
  4. The command fails with the following error:

    error: unexpected argument '-e' found
    tip: to pass '-e' as a value, use '-- -e'
    

Expected Behavior

The command should successfully install the project in development mode with all development dependencies.

Actual Behavior

The command fails because uv add is designed to add external dependencies to a project, not to install the current project in editable mode with extras.

Environment Information

  • uv version: 0.6.9
  • OS: macOS 14.6.1
  • Python version: 3.12.5

Suggested Fix

The CONTRIBUTING.md file should be updated to use the correct command:

Replace:

# Install development dependencies with uv
uv add -e ".[dev]"

With:

# Install development dependencies with uv
uv sync --extra dev

This command correctly installs the project in editable mode with all development dependencies.

Verification

I've verified that uv sync --extra dev successfully installs all development dependencies, and the development environment works correctly. After running this command, I was able to run uv run pytest and other development tools without issues.

Documentation Reference

According to the [official uv documentation]:

uv reads optional dependencies from the [project.optional-dependencies] table. These are frequently referred to as "extras".
uv does not sync extras by default. Use the --extra option to include an extra.

$ uv sync --extra foo

The documentation also notes that syncing the environment will install the project as an editable package by default, which is the desired behavior for development.

Question for Maintainers

Would this solution be acceptable for you? If so, I'd be happy to submit a PR to update the CONTRIBUTING.md file with the correct command.


I hope this helps improve the onboarding experience for new contributors. Thank you for maintaining this useful project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions