astral-sh / uv

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

Packages being built even if flagged as "only-binary" #8439

Open arnaldojvg opened 2 hours ago

arnaldojvg commented 2 hours ago

I have this minimal pyproject.toml

[project]
name = "my-project"
version = "0.2.0"
description = "Cool project"
requires-python = ">=3.10"
dependencies = [ "pyarrow==17.0.0" ]

[tool.uv]
[tool.uv.pip]
only-binary = ["pyarrow"]
(venv) (base) ➜  test_uv  uv cache clean
Clearing cache at: /Users/arnaldovarela/.cache/uv
Removed 1770 files (200.6MiB)
(venv) (base) ➜  test_uv  uv self update
info: Checking for updates...
success: You're on the latest version of uv (v0.4.25)
(venv) (base) ➜  test_uv  uv sync       
warning: `VIRTUAL_ENV=venv` does not match the project environment path `.venv` and will be ignored
Using CPython 3.10.4
Creating virtual environment at: .venv
Resolved 3 packages in 0.92ms
   Built numpy==2.1.2                                                                                                                                                                                                                                               error: Failed to prepare distributions
  Caused by: Failed to download and build `pyarrow==17.0.0`
...

And the packages are built instead of using the binaries. This is a problem as to build pyarrow some apache dependencies and cmake are required to be installed.

I'm running this on a Mac M1 running 14.5 (23F79).

arnaldojvg commented 2 hours ago

When installing with Pipfile:

[[source]]
url = "https://pypi.org/simple"
name = "pypi"
verify_ssl = true

[packages]
pyarrow = "==17.0.0"

[requires]
python_version = "3.10"

it takes just a few seconds and no need to build:

(venv) (base) ➜  test_uv  pipenv install
Loading .env environment variables...
Courtesy Notice:
Pipenv found itself running within a virtual environment,  so it will automatically use that environment, instead of  creating its own for any project. You can set
PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create  its own instead.
You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (9f6dbf61cecaca8a7db4e36abb151730ab51fadc17e8c779b2687808a27abe20)!
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing dependencies from Pipfile.lock (7abe20)...