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

[workspace] uv run --with=git+workspace fails with Build backend failed to determine requirements #9301

Open
PhilipVinc opened this issue Nov 21, 2024 · 4 comments
Labels
question Asking for clarification or support

Comments

@PhilipVinc
Copy link

See the error below.

I'm unsure what the error means

uv run --with git+https://github.com/PhilipVinc/uvtest2 python
 Updated https://github.com/PhilipVinc/uvtest2 (d5efb81)
   Built netket @ git+https://github.com/PhilipVinc/uvtest2@d5efb812fbf0dd2a1c7cc23802a003bdc1b08409#subdirectory=external/netket
   Built netket-checkpoint @ git+https://github.com/PhilipVinc/uvtest2@d5efb812fbf0dd2a1c7cc23802a003bdc1b08409#subdirectory=packages/netket_checkpoint
   Built deepnets @ git+https://github.com/PhilipVinc/uvtest2@d5efb812fbf0dd2a1c7cc23802a003bdc1b08409#subdirectory=packages/deepnets
   Built netket-pro @ git+https://github.com/PhilipVinc/uvtest2@d5efb812fbf0dd2a1c7cc23802a003bdc1b08409#subdirectory=packages/netket_pro
  × Failed to download and build `omnia @ git+https://github.com/PhilipVinc/uvtest2@d5efb812fbf0dd2a1c7cc23802a003bdc1b08409`
  ╰─▶ Build backend failed to determine requirements with `build_wheel()` (exit status: 1)

      [stderr]
      error: Multiple top-level packages discovered in a flat-layout: ['config', 'packages', 'external', 'containers'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.
@charliermarsh
Copy link
Member

This appears to be a setuptools error. It's not specific to uv. Is your project structured properly? Can you build it with python -m build?

@charliermarsh charliermarsh added the question Asking for clarification or support label Nov 21, 2024
@PhilipVinc
Copy link
Author

I am trying to add a workspace as a dependency to a project. This works locally, but it does not work if I add it from git.

Compare

# This works
git clone https://github.com/PhilipVinc/uvtest2
mkdir test && cd test
uv init
uv add ../uvtest2

against

mkdir test2 && cd test2
uv init
uv add git+https://github.com/PhilipVinc/uvtest2

which fails with the error above

@PhilipVinc
Copy link
Author

I cannot build the project because it's a workspace, not a python package.

@charliermarsh
Copy link
Member

Yeah, I don't know if this should work. We respect "virtual projects" (or non-package projects) locally, in workspaces, but I don't think we can treat arbitrary dependencies that way. It would break any (real) package that relies on an implicit build backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants