-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Environment for PyPI Source Dependencies #1340
Comments
I find 1. a bit verbose if you need to add it to every environment. Building a library: [host-dependencies] # or [pypi-build-environment]
python = "*"
hatchling = "*"
[pypi-dependencies]
polarify = {path = ".", editable = true, ignore-dependencies = true, build-isolation = false}
[environments]
default = ["test"]
pl014 = ["pl014", "py39", "test"]
pl015 = ["pl015", "py39", "test"]
# ... here, Building an application: [host-dependencies] # or [pypi-build-environment]
python = "*"
hatchling = "*"
[feature.dev.pypi-dependencies] # or [pypi-dependencies]
polarify = {path = ".", editable = true, ignore-dependencies = true, build-isolation = false}
[feature.prod.pypi-dependencies]
polarify = {path = ".", editable = false, ignore-dependencies = true, build-isolation = false}
[environments]
default = { features = ["dev"], solve-group = "prod" }
prod = { features = ["prod"], solve-group = "prod" } here, |
Design proposal PyPI build environmentThe goal for the users is to make the solves faster and possible on more systems. We'll do this by allowing a user to define a pypi build environment. The manifest
|
Addition to the Edge-case would be that we took that idea from uv: https://docs.astral.sh/uv/concepts/resolution/#dependency-metadata. But because of conda we would need it less. |
Problem description
The current implementation uses the conda environments as a base environments for the building of python packages source distributions. It provides the python interpreter to the uv solve that pixi triggers when solving pypi-dependencies. Even without needing to install an environment, if said environment contains pypi-dependencies the conda prefix for that environment still needs to be installed, this is because we do not know before-hand if there are any source dists that need to be built.
This results in multiple downsides:
pixi install
installs all environments in multi env setting whenpypi-dependency
is used #1046--no-install
or alock
(that does no install) command when an environment contains pypi-dependencies pip compile equivalent / trigger solve #1131Proposal
Give the user the ability to create a custom build environment for the pypi-dependencies which only contains a minimal set of requirements which can be installed on all systems. For example only python, skipping all other dependencies. This also allows for more options, like installing specific dependencies for building a package, and in conjunction with the addition of #1124 can avoid having to use pypi-dependencies for building a source dist altogether.
The following project can only be solved on a linux-64 machine:
Specification in manifest
Option 1: Add build environment to environment
Pros:
Cons:
Option 2: A pypi-build-environment table
Pros:
[pypi-build-environment]
it is automatically inherited in all other environments.Cons:
Option 3: Use host-dependencies
This would traverse all environments and figure out the unique and re-usable build environments per environment.
Pros:
Cons:
pixi build
although you will probably want those dependencies in that caseHow is this going to be backwards compatible?
The current behavior doesn't change, so a pypi build environment will be an opt-in feature, as for simple use-cases it does work.
Alternative solutions to the described problems
There are some alternatives:
There are challenges:
uv
so are eagerly selected.We do think that
wheel-only
is a good idea nonetheless that we would want to implement.The text was updated successfully, but these errors were encountered: