prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
2.28k stars 135 forks source link

Make pixi use build-backend dependencies from conda packages instead of uv build isolated variants #1088

Open pavelzw opened 3 months ago

pavelzw commented 3 months ago

Problem description

https://github.com/prefix-dev/pixi/pull/1084#issuecomment-2027053618

In corporate environments, you might not have access to pypi but only a conda server. It would be cool if pixi was able to lock the used build backends in the lockfile and use it from conda and not pypi when specifying source dependencies in pypi-dependencies.

In general, I think it would be beneficial to lock the used build-backends for reproducibility.

tdejager commented 3 months ago

Locking the build-backends is something that is being discussed in the pypi world as well. So that should be useful for sure, currently UV does another resolve to determine the build environment something we did in RIP as well, I don't know if we can influence this.

pavelzw commented 3 months ago

If we can't influence this, could we maybe get a no-build-isolation flag?

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

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

I would love to get the editable installs feature in places where pypi is not available.

tdejager commented 3 months ago

NoBuildIsolation is possible for sure, we should give that a go!

pavelzw commented 3 months ago

In our workflows we not only use --no-build-isolation but also --no-deps since we want to basically do everything with conda and use pip only for actually moving the project into the python env. Maybe(?) it could make sense to also have the option available in pixi and if pixi recognizes that we use no-build-isolation and no-deps, it doesn't try to solve pypi-dependencies at all? But i'm personally not 100% sold on the idea yet...

tdejager commented 3 months ago

Hmm I understand, let me think about it more, I'll come back to this.

tdejager commented 3 months ago

I think, what you actually want might be a build and install in the current environment functionality, which would replace your use-case for editables as dependencies?

pavelzw commented 3 months ago

This would be fine for me as well if it's well thought out. The main thing I want is to replace pixi run postinstall 😅