-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Summary
pixi recently pushed an update that makes installing --no-build-isolation packages much easier and a one-liner. I was wondering if there's any chance of uv implementing this type of behavior since it seems a lot more natural than what is currently described in the docs (i.e. multi-step environment build, listing build dependencies). For example, if I am installing flash-attn, I will most likely be listing/pinning the version of torch I will be working with at the top of my pyproject.toml, and it seems like it would make sense to resolve those packages before installing any no-build-isolation dependencies.
This issue and this comment hint that some people in the community think the above behavior is more natural as well. Any thoughts are much appreciated!
Example
Here is an example of installing flash-attn with no-build-isolation via pixi
[project]
name = "test-pixi"
version = "0.1.0"
requires-python = ">=3.11,<3.13"
dependencies = [
"torch==2.6.0",
"flash-attn",
]
[build-system]
requires = ["uv_build>=0.8.9,<0.9.0"]
build-backend = "uv_build"
[tool.pixi.project]
# Minimal channel usage: NVIDIA for full CUDA toolkit (with nvcc), conda-forge for Python itself.
channels = ["nvidia", "conda-forge"]
platforms = ["linux-64"]
# Tell pixi we are on a CUDA 12.4 machine so it doesn’t “helpfully” resolve CPU-only stuff.
[tool.pixi.system-requirements]
cuda = "12.4"
# Conda-side deps ONLY for interpreter + CUDA toolkit (provides nvcc)
[tool.pixi.dependencies]
python = "3.12.*"
cuda-toolkit = "12.4.*"
# Disable build isolation for CUDA-extension packages so they can import torch at build time
[tool.pixi.pypi-options]
no-build-isolation = ["flash-attn"] # This gets installed AFTER torch is resolved/installedThe command to install would just be:
pixi installHowever, I have to use all the workarounds described in the docs to get flash-attn installed via uv. It seems a bit inconvenient/lower QoL even if it is only a few extra lines of toml and a few extra commands. It would be nice to just declaritively write the pyproject.toml similar to the above pixi spec and do uv sync.