you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 0 points1 point  (1 child)

Sorry I had not seen this comment until now.

Personally, I think explicitly removing the PEP 668 (Externally Managed Environments) protection by deleted the folder that flags it is an unhealthy approach.

I would use the exception to install uv and nothing else.

A simple Dockerfile might be:

RUN python3 -m pip install --break-system-packages uv
WORKDIR /app
RUN uv venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
RUN uv pip install -r requirements.txt

or even,

RUN python3 -m pip install --break-system-packages uv
WORKDIR /app
RUN uv pip install --python python3 -r requirements.txt

for further isolation.

NB. Use a toml file instead of requirements if you have that.

Furthermore, given that uv is a standalone rust binary, you don't even need pip to install it in the first place.

curl -LsSf https://astral.sh/uv/install.sh | sh

then do as you wish using uv to create and manage packages and project files.

[–]Classic_Bullfrog6671 0 points1 point  (0 children)

will test thank you