Skip to content

Requirements exported from uv.lock include dev dependency groups #921

Open

Description

@tdstein

Problem

--requirements-file uv.lock exports the project's dev dependency groups into the bundle's requirements. Connect then installs test and lint tools that the deployed content never uses, and the deploy fails outright when a dev dependency is a local path.

uv_export runs uv export without --no-dev (inspect_environment.py#L233-L262), and uv export includes the dev group by default.

Reproduce (main @ 01878e8)

uv init --app --python 3.12 devdeps && cd devdeps
uv add flask
uv add --dev pytest
rsconnect write-manifest api -r uv.lock .
cat requirements.txt.lock

The exported requirements include pytest and its dependencies (iniconfig, pluggy, pygments, colorama, ...) next to flask.

Consequences seen on Connect

  • rsconnect as a dev dependency (uv add --dev rsconnect-python, a common setup): rsconnect-python itself is filtered out, but its dependencies (semver, pyjwt, uv, pip, ...) still ship.
  • Dev dependency from a local path (e.g. a wheel or editable checkout): the export contains a line like ../../dist/rsconnect_python-<version>-py3-none-any.whl, which Connect cannot install. The deploy fails with Error from Connect server: process exited with code 1.

Expected

Only the project's runtime dependencies are exported. Pass --no-dev to uv export. Whether to also exclude other non-default groups (--only-group/--no-default-groups) is worth deciding at the same time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions