Skip to content

uv export ignores --no-emit-workspace if --all-packages is passed but there are not additional packages in the workspace #18070

@cavedon

Description

@cavedon

Summary

For a project with no additional workspace members, uv export --no-emit-workspace --all-packages will emit -e ., but it should not, as --no-emit-workspace was passed.

How to reproduce:

% uv --version
uv 0.10.3 (c75a0c625 2026-02-16)

% uv init --package test
Initialized project `test` at `/private/tmp/test`

% cd test

% uv lock
Using CPython 3.14.0
Resolved 1 package in 3ms

Unexpected output:

% uv export --no-emit-workspace --all-packages
Using CPython 3.14.0
Resolved 1 package in 0.94ms
# This file was autogenerated by uv via the following command:
#    uv export --no-emit-workspace --all-packages
-e .

What I expected instead: same as above, but without -e ..

I remove --all-packages the output is correct:

% uv export --no-emit-workspace
Using CPython 3.14.0
Resolved 1 package in 0.85ms
# This file was autogenerated by uv via the following command:
#    uv export --no-emit-workspace

If I add a package in the workspace, the output is correct:

% uv init subtest
Adding `subtest` as member of workspace `/private/tmp/test`
Initialized project `subtest` at `/private/tmp/test/subtest`

% uv lock
Using CPython 3.14.0
Resolved 2 packages in 1ms
Added subtest v0.1.0

% uv export --no-emit-workspace --all-packages
Using CPython 3.14.0
Resolved 2 packages in 1ms
# This file was autogenerated by uv via the following command:
#    uv export --no-emit-workspace --all-packages

Platform

macOS 26.3

Version

uv 0.10.3 (c75a0c6 2026-02-16)

Python version

CPython 3.14.0

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