Editable packages only for specific features/environments #1860
-
When using editable local installations of pip packages I run into issues when building docker containers. My pixi file: [project]
name = "foo"
version = "1.0.0"
description = "bar"
authors = [
"baz",
]
platforms = ["linux-64", "osx-arm64"]
channels = ["conda-forge"]
[environments]
myenv-static = { features = ["myenv-static"], solve-group = "myenv-static" }
myenv-dynamic = { features = ["myenv-dynamic"], solve-group = "myenv-dynamic" }
[dependencies]
python = "3.11"
pip = ">=24.2"
[feature.myenv-static.dependencies]
pytest = ">=8.3.2,<9"
[feature.myenv-static.pypi-dependencies]
moto = "~=5.0.12"
[feature.myenv-dynamic.dependencies]
pandas = ">2,<3"
[feature.myenv-dynamic.pypi-dependencies]
mylib = { path = "./mylib", editable = true }
My dockerfile:
When executed with
This can be remediated when enabling/pushing up the See https://github.com/geoHeil/pixi-editable-reproducible-quesetion-v1 for details and folder structure |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Nice setup, to skip the sanity checks in the installation, you can add # syntax=docker/dockerfile:1.9.0
FROM ghcr.io/prefix-dev/pixi:0.27.1-bookworm
WORKDIR /app
COPY pixi.toml .
COPY pixi.lock .
RUN pixi install -e myenv-static --frozen -vvv
RUN pixi shell-hook --frozen -e myenv-static -s bash > /shell-hook
RUN echo "#!/bin/bash" > /app/entrypoint_myenv_static.sh
COPY mylib mylib
RUN pixi install -e myenv-dynamic --frozen -vv
RUN pixi shell-hook --frozen -e myenv-dynamic -s bash > /shell-hook |
Beta Was this translation helpful? Give feedback.
Nice setup, to skip the sanity checks in the installation, you can add
--frozen
to all commands that want to install.