yehoshuadimarsky opened a new issue, #37785: URL: https://github.com/apache/airflow/issues/37785
### Description I am trying to use the new phenomenal tool [`uv`](https://github.com/astral-sh/uv/) to add python packages on top of the base Airflow image. I kept running into the issue of `uv` not supporting non-virtual-envs, but this is now supported with [version 0.1.12](https://github.com/astral-sh/uv/releases/tag/0.1.12) Here is my sample Dockerfile. I cannot get it to work with either of these new flags: `--python` or `--system`. ```Dockerfile FROM apache/airflow:slim-2.7.3-python3.10 ENV PIP_DISABLE_PIP_VERSION_CHECK=1 ENV PIP_ROOT_USER_ACTION="ignore" USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ build-essential libmariadb-dev \ && apt-get autoremove -yqq --purge \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* USER airflow RUN pip install "uv==0.1.12" COPY requirements.txt / COPY constraints.txt / # with --python RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --python $(which python) # with --system # RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --system ``` In both cases, I get this error: ``` => ERROR [6/6] RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --python $(which python 18.5s ------ > [6/6] RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --python $(which python): 4.061 Resolved 239 packages in 3.48s 16.86 Downloaded 238 packages in 12.79s 18.07 error: failed to remove file `/usr/local/lib/python3.10/site-packages/_distutils_hack/__init__.py` 18.07 Caused by: Permission denied (os error 13) ------ Dockerfile.airflow2:22 -------------------- 20 | COPY constraints.txt / 21 | 22 | >>> RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --python $(which python) 23 | 24 | # RUN uv pip install --no-cache -r /requirements.txt -c /constraints.txt --system -------------------- ERROR: failed to solve: process "/bin/bash -o pipefail -o errexit -o nounset -o nolog -c uv pip install --no-cache -r /requirements.txt -c /constraints.txt --python $(which python)" did not complete successfully: exit code: 2 ``` I thought, ok, let me run it as `USER root`, but then I get an error about installing `pip` packages as root, from here: https://airflow.apache.org/docs/docker-stack/build.html#adding-new-pypi-packages-individually **Any suggestions on using `uv` with the Airflow Docker image?** Thanks ### Use case/motivation _No response_ ### Related issues I see that Airflow has already adopted `uv` internally for its CI (https://github.com/apache/airflow/issues?q=uv), so I think this should be doable for the external Docker image as well ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
