uv/crates
konsti d407bbbee6
Special case missing header build errors (on linux) (#354)
One of the most common errors i observed are build failures due to
missing header files. On ubuntu, this generally means that you need to
install some `<...>-dev` package that the documentation tells you about,
e.g. [mysqlclient](https://github.com/PyMySQL/mysqlclient#linux) needs
`default-libmysqlclient-dev`, [some psycopg
versions](https://www.psycopg.org/psycopg3/docs/basic/install.html#local-installation)
(i remember that this was always required at some earlier point) require
`libpq-dev` and pygraphviz wants `graphviz-dev`. This is quite common
for many scientific packages (where conda has an advantage because they
can provide those package as a dependency).

The error message can be completely inscrutable if you're just a python
programmer (or user) and not a c programmer (example: pygraphviz):

```
warning: no files found matching '*.png' 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'
pygraphviz/graphviz_wrap.c:3020:10: fatal error: graphviz/cgraph.h: No such file or directory
 3020 | #include "graphviz/cgraph.h"
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
```

The only relevant part is `Fatal error: graphviz/cgraph.h: No such file
or directory`. Why is this file not there and how do i get it to be
there?

This is even harder to spot in pip's output, where it's 11 lines above
the last line:


![image](7a3d7279-e7b1-4511-ab22-d0a35be5e672)

I've special cased missing headers and made sure that the last line
tells you the important information: We're missing some header, please
check the documentation of {package} {version} for what to install:


![image](4bbb8923-5a82-472f-ab1f-9e1471aa2896)

Scrolling up:


![image](89a2495a-e188-4288-b534-ad885ee08763)

The difference gets even clearer with a default ubuntu terminal with its
80 columns:


![image](49fb27bc-07c6-4b10-a1a1-30ec8e112438)

---

Note that the situation is better for a missing compiler, there i get:

```
[...]
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 'gcc' failed: No such file or directory
---
```
Putting the last line into google, the first two results tell me to
`sudo apt-get install gcc`, the third even tells me about `sudo apt
install build-essential`
2023-11-08 15:26:39 +00:00
..
distribution-filename Fix index out of bounds in SourceDistributionFilename::parse (#353) 2023-11-07 11:44:40 +00:00
gourgeist Remove virtualenv setup from gourgeist (#339) 2023-11-06 18:32:45 +00:00
install-wheel-rs Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
pep440-rs cargo upgrade --incompatible (#330) 2023-11-06 14:14:47 +00:00
pep508-rs cargo upgrade --incompatible (#330) 2023-11-06 14:14:47 +00:00
platform-host fix platform detection on Linux (#359) 2023-11-07 11:39:35 -05:00
platform-tags Store all distributions rather than compatible wheels (#114) 2023-10-17 17:09:31 -04:00
puffin-build Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-cache Require URL dependencies to be declared upfront (#319) 2023-11-05 17:09:58 +00:00
puffin-cli Add --no-build (#358) 2023-11-08 10:05:15 -05:00
puffin-client Fix mastodon-py dist-info handling (#336) 2023-11-07 12:36:11 +01:00
puffin-dev Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-dispatch Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-distribution Respect direct URLs in puffin installer (#345) 2023-11-07 09:11:27 -05:00
puffin-git Add SSL to possible spurious errors (#361) 2023-11-07 18:53:39 +00:00
puffin-installer Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-interpreter Make cache non-optional in most crates (#293) 2023-11-02 13:40:20 -04:00
puffin-normalize Split puffin-package into requirements.txt parser and pypi-types (#341) 2023-11-06 18:19:49 +00:00
puffin-resolver Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-traits Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-workspace Update pyproject-toml to 0.8.0 (#329) 2023-11-06 13:16:36 +00:00
pypi-types Respect direct URLs in puffin installer (#345) 2023-11-07 09:11:27 -05:00
requirements-txt Split puffin-package into requirements.txt parser and pypi-types (#341) 2023-11-06 18:19:49 +00:00
README.md Add source distribution filename abstraction (#154) 2023-10-20 17:45:57 +02:00

Crates

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

puffin-cli

Command-line interface for the Puffin package manager.

puffin-client

Client for interacting with PyPI-compatible HTTP APIs.

puffin-installer

Functionality for installing Python packages into a virtual environment.

puffin-interpreter

Functionality for detecting and leveraging the current Python interpreter.

puffin-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

puffin-resolver

Functionality for resolving Python packages and their dependencies.

distribution-filename

Functionality for parsing wheel filenames as per PEP 427.