Skip to content

uv attempts to install dependencies for wrong platforms #500

Description

@ink-splatters

The issue

this should be properly handled via uv environments

Steps to Reproduce

Follow this flow. Observe uv attempts to install wrong dependencies.

❯ cat <<'EOF' > pyproject.toml
[project]
name = "example"
version = "0.1.0"

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
pyinotify = {version = "^0.9.6", platform = "linux"}
EOF

❯ uname
Darwin

❯ uvx migrate-to-uv
Locking dependencies with "uv lock"...
  × Failed to build `pyinotify==0.9.6`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      inotify is not available on macosx-11.0-arm64
...
Click here for the full log
❯ cat <<'EOF' > pyproject.toml
[project]
name = "example"
version = "0.1.0"

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
pyinotify = {version = "^0.9.6", platform = "linux"}
EOF

❯ uvx migrate-to-uv
Locking dependencies with "uv lock"...
  × Failed to build `pyinotify==0.9.6`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      inotify is not available on macosx-11.0-arm64

      hint: This usually indicates a problem with the package or the build environment.
  help: `pyinotify` (v0.9.6) was included because `example` (v0.1.0) depends on `pyinotify>=0.9.6, <0.10`
warning: An error occurred when locking dependencies, so "uv.lock" was not created.
Locking dependencies with "uv lock" again to remove constraints...
  × Failed to build `pyinotify==0.9.6`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      inotify is not available on macosx-11.0-arm64

      hint: This usually indicates a problem with the package or the build environment.
  help: `pyinotify` (v0.9.6) was included because `example` (v0.1.0) depends on `pyinotify>=0.9.6, <0.10`
warning: An error occurred when locking dependencies after removing constraints.
Successfully migrated project from Poetry to uv!

Metadata

Metadata

Assignees

No one assigned

    Labels

    manager:poetryRelates to Poetry package manager

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions