astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
24.35k stars 706 forks source link

Installation of `pygraphviz` fails (but still updates uv.lock) #7992

Open david-waterworth opened 2 weeks ago

david-waterworth commented 2 weeks ago

I'm not sure if this is a uv issue - but this works with pip / poetry but fails with uv

I've followed https://pygraphviz.github.io/documentation/stable/install.html (specifically graghviz is installed)

I'm using py3.10 on Ubuntu 24.04 uv==0.4.18

If I install using pip

$python -m venv .venv
$. .venv/bin/activate
$pip install pygraphviz

  Downloading https://.../simple/pygraphviz/1.14/pygraphviz-1.14.tar.gz (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.0/106.0 kB 2.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pygraphviz
  Building wheel for pygraphviz (pyproject.toml) ... done
  Created wheel for pygraphviz: filename=pygraphviz-1.14-cp310-cp310-linux_x86_64.whl size=210709 sha256=0e1d00dc911e52d201a8f9b8466d0569ec74f34a78bc243d358fc50c52987f15
  Stored in directory: /home/dave/.cache/pip/wheels/5c/47/fd/6960e1b155206881d2fe8bfcd96d6e71a7ef45a099f48ecf19
Successfully built pygraphviz
Installing collected packages: pygraphviz
Successfully installed pygraphviz-1.14

there's no issue, but under uv I get a build failure (log at end)

Also, despite uv add pygraphviz failing (so not updating pyproject.toml) - the uv.lock file is updated

[[package]]
name = "pygraphviz"
version = "1.14"
source = { registry = "https://xxx-xxx.d.codeartifact.xxx.amazonaws.com/pypi/xxx/simple/" }
sdist = { url = "https://xxx-xxx.d.codeartifact.xxx.amazonaws.com/pypi/xxx/simple/pygraphviz/1.14/pygraphviz-1.14.tar.gz", hash = "sha256:c10df02377f4e39b00ae17c862f4ee7e5767317f1c6b2dfd04cea6acc7fc2bea" }

Is this expected?

$ uv add pygraphviz
Resolved 219 packages in 6.48s
error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: pygraphviz==1.14
  Caused by: Build backend failed to build wheel through `build_wheel()` (exit status: 1)
--- stdout:
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/graphviz.py -> build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/agraph.py -> build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/__init__.py -> build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/testing.py -> build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/scraper.py -> build/lib.linux-x86_64-cpython-310/pygraphviz
creating build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_readwrite.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_graph.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_string.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_clear.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_html.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_edge_attributes.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_layout.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_scraper.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_close.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/__init__.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_repr_mimebundle.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_unicode.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_drawing.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_node_attributes.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
copying pygraphviz/tests/test_subgraph.py -> build/lib.linux-x86_64-cpython-310/pygraphviz/tests
running egg_info
writing pygraphviz.egg-info/PKG-INFO
writing dependency_links to pygraphviz.egg-info/dependency_links.txt
writing top-level names to pygraphviz.egg-info/top_level.txt
reading manifest file 'pygraphviz.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'pygraphviz.egg-info/SOURCES.txt'
copying pygraphviz/graphviz.i -> build/lib.linux-x86_64-cpython-310/pygraphviz
copying pygraphviz/graphviz_wrap.c -> build/lib.linux-x86_64-cpython-310/pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
creating build/temp.linux-x86_64-cpython-310/pygraphviz
clang -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -DSWIG_PYTHON_STRICT_BYTE_CHAR -I/home/dave/.cache/uv/builds-v0/.tmpbqXggC/include -I/home/dave/.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/include/python3.10 -c pygraphviz/graphviz_wrap.c -o build/temp.linux-x86_64-cpython-310/pygraphviz/graphviz_wrap.o
--- stderr:
warning: no files found matching '*.swg'
warning: no files found matching '*.png' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching '*.txt' under directory 'doc'
warning: no files found matching '*.css' under directory 'doc'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.svn' found anywhere in distribution
no previously-included directories found matching 'doc/build'
error: command 'clang' failed: No such file or directory
---
zanieb commented 2 weeks ago

See https://github.com/astral-sh/uv/issues/7525 for discussion of similar build errors.

I'm surprised we update the lockfile, we can look into that.

Aditya-PS-05 commented 2 weeks ago

@zanieb , Can you assign me this issue? I would be great if you add the hacktoberfest label. As I am participating in hacktoberfest.

charliermarsh commented 4 days ago

@zanieb -- I guess we should be resetting (or even removing, if it didn't exist) the uv.lock?