pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Expose UV `NoBuildIsolation` in some way

Open tdejager opened this issue 1 year ago • 3 comments

Problem description

UV, like pip has the concept of NoBuildIsolation where it doesn't create a venv for building and it does not install requirements, these need to be installed.

Exposing this allows us to use conda dependencies for building.

The question mainly is how we want to expose this, @pavelzw suggested: https://github.com/prefix-dev/pixi/issues/1088#issuecomment-2027250661

[pypi-dependencies]
my-package = {path = ".", editable = true, no-build-isolation = true}

[dependencies]
setuptools = "*"
setuptools-scm = "*"

Because this is somwhat a global setting in UV to support it in this way we would need to create two seperate BuildDispatch's to support this and two seperate DistributionDatabases, and select which one to use somehow.

The easiest approach is to use a global project setting and then this is enabled for every sdist and every editable. This is quite brittle though, because if you use another sdist you might need to manually update your dependencies (to account for new build dependencies), as uv will no longer handle this.

tdejager avatar Apr 05 '24 14:04 tdejager

What is the reason we want build isolation? From my perspective, the conda environment that is created to run the pypi build is already isolated. I feel like Im missing something.

baszalmstra avatar Jul 29 '24 07:07 baszalmstra

@baszalmstra I also can't think of a situation where we would want build isolation. IIRC, the current situation is that we always have build isolation.

Hofer-Julian avatar Jul 29 '24 08:07 Hofer-Julian

I will get back to this, but there are multiple reasons :)

tdejager avatar Jul 29 '24 09:07 tdejager

https://github.com/prefix-dev/pixi/pull/1909 was merged which should enable this!

baszalmstra avatar Sep 03 '24 11:09 baszalmstra

Wonderful ! The escape hatch per package is perfect for security as well. Thanks for the hard work.

jeremyben avatar Sep 03 '24 11:09 jeremyben

Great that you find it useful. Yeah the reasoning from my end is also that the feature is less useful if you cannot set it per package as you would need to manually manage all your sdist dependencies for all sdists in the project otherwise.

tdejager avatar Sep 04 '24 05:09 tdejager