Conversation
083e276 to
5fe2774
Compare
|
Can you describe why the current set of options isn't sufficient, and why you can't use a venv? |
@konstin Currently,
In contrast, the
Furthermore, there is clearly established community demand for this feature, as evidenced by the discussions in: |
|
Please do not use LLMs write responses (https://github.com/astral-sh/.github/blob/main/AI_POLICY.md), instead describe your specific problem in your own words. |
@konstin My English isn’t that good—I’m just using AI for translation, but the ideas I’m expressing are my own. In simple terms,
The issue #13129 with a similar request clearly explains the necessity of the |
|
For example, as I mentioned in the first point above, the packages installed during the container build and those installed by the user in the entrypoint are separated by default, which leads to this issue: Although this can be resolved by configuring a virtual environment, it introduces additional complexity. The simplest, most straightforward, and least error-prone approach—and also the most common practice—is to install all packages into the system-wide site-packages within the container. |
|
A venv is barely any overhead, and I'm not sure if |
However, #13129 was rejected because @zanieb believed that the Furthermore, the original context for implementing If you believe merging this PR would increase the complexity of the codebase, then you should also consider removing the |
The uv documentation states that @konstin Since |
Purpose of the change:
By using the
--rootflag, you can install packages into a directory separate from your host filesystem—a technique particularly useful for constructing minimal containers.This approach is perfect for multi-stage Docker builds, as it allows you to generate a clean, isolated set of dependencies to be copied into a final image that doesn't necessarily have the tools or environment to run the installer itself (because e.g.
pipis not installed).Example with
pip:Detailed changes:
This PR adds the
--rootoption touv pip install,uv pip uninstall,uv pip sync,uv pip freeze,uv pip show, anduv pip list.The usage and behavior are fully consistent with
pip.Test Plan
Added comprehensive test cases.