Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"uv build --all" command not working? #8530

Open
lucas-labs opened this issue Oct 24, 2024 · 4 comments · May be fixed by #8537
Open

"uv build --all" command not working? #8530

lucas-labs opened this issue Oct 24, 2024 · 4 comments · May be fixed by #8537
Assignees
Labels
bug Something isn't working

Comments

@lucas-labs
Copy link

I don't know if this is a bug or if I'm doing something wrong, but I can't get the uv build --all command to work.

According to the uv build --help command, the --all flag should build all packages in the workspace.

$ uv build --help
...

Options:
      --package <PACKAGE> Build a specific package in the workspace
+     --all               Builds all packages in the workspace

I have a workspace with two packages, lib1 and lib2.

workspace
├── packages/
│   ├── lib1/
│   │   ├── hello.py
│   │   ├── pyproject.toml
│   │   └── README.md
│   └── lib2/
│       ├── hello.py
│       ├── pyproject.toml
│       └── README.md
└── pyproject.toml

In the root pyproject.toml, I have the following configuration to define the members of the workspace (I also tried specifying the path to each package individually, like members = ["packages/lib1", "packages/lib2"] but it didn't work either):

...

[tool.uv.workspace]
members = ["packages/*"]

When I run uv build --all, the following error is raised:

$ uv build --all
error: No packages found in workspace

If I run uv build --package lib1, it works as expected, but we are forced to build each package individually.

$ uv build --package lib1
Building source distribution...
...
Successfully built dist\lib1-0.1.0.tar.gz and dist\lib1-0.1.0-py3-none-any.whl

$ uv build --package lib2
Building source distribution...
...
Successfully built dist\lib2-0.1.0.tar.gz and dist\lib2-0.1.0-py3-none-any.whl

Is this a bug or am I missing something / misinterpreting what the --all flag is supposed to do?

Thanks!

@lucas-labs lucas-labs changed the title " uv build --all" command not working? "uv build --all" command not working? Oct 24, 2024
@charliermarsh
Copy link
Member

Interesting... this works as expected for me:

❯ uv init --package foo
Initialized project `foo` at `/Users/crmarsh/workspace/uv/foo`

❯ cd foo

❯ uv init --package bar
Adding `bar` as member of workspace `/Users/crmarsh/workspace/uv/foo`
Initialized project `bar` at `/Users/crmarsh/workspace/uv/foo/bar`

❯ uv init --package baz
Adding `baz` as member of workspace `/Users/crmarsh/workspace/uv/foo`
Initialized project `baz` at `/Users/crmarsh/workspace/uv/foo/baz`

❯ uv build --all
[bar] Building source distribution...
[baz] Building source distribution...
[foo] Building source distribution...
[bar] Building wheel from source distribution...
[baz] Building wheel from source distribution...
[foo] Building wheel from source distribution...
Successfully built dist/bar-0.1.0.tar.gz and dist/bar-0.1.0-py3-none-any.whl
Successfully built dist/baz-0.1.0.tar.gz and dist/baz-0.1.0-py3-none-any.whl
Successfully built dist/foo-0.1.0.tar.gz and dist/foo-0.1.0-py3-none-any.whl

@charliermarsh
Copy link
Member

Oh, do your projects have a [build-system] field? If not, they're probably being skipped by --all (but unintentionally working with --package).

@charliermarsh charliermarsh self-assigned this Oct 24, 2024
@charliermarsh
Copy link
Member

I'm going to add some error messages to fix this up.

@charliermarsh charliermarsh added the bug Something isn't working label Oct 24, 2024
@lucas-labs
Copy link
Author

Oh, do your projects have a [build-system] field? If not, they're probably being skipped by --all

Nope they didn't have a [build-system] 😅, they are working now after adding a build system. Makes sense.

(but unintentionally working with --package).
I'm going to add some error messages to fix this up.

Yes, that would be great, in order to avoid confusion.

Thanks for your help again, Charlie!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants