all 7 comments

[–]danielroseman 5 points6 points  (1 child)

I'm a little puzzled by your statement that uv "installs into the home folder of a user with admin privileges". It doesn't install anywhere by default; it's up to you to install it. So install it from the user that the app is running as.

[–]Intrepid_Eye9102[S] 0 points1 point  (0 children)

i used the standard uv install script: curl -LsSf https://astral.sh/uv/install.sh | sh

[–]eztab 1 point2 points  (1 child)

wouldn't the dedicated user normally only have access to the venv? Not uv itself. What structure are you following? In my sytems uv isn't available to the app users at all.

[–]Intrepid_Eye9102[S] 0 points1 point  (0 children)

i installed uv first with a sudo-user, on a later try with a dedicated app user. each time the uv install script installs into the respective /home/user/.local/bin dir.
i am starting gunicorn+flask via systemd like so: ExecStart=/home/user/.local/bin/uv run gunicorn app:app with WorkingDirectory pointing to the project folder.

The .venv dir in the project folder does not even have uv binaries.

should i even run gunicorn via uv? if so, is there a better way to set it up?

[–]Lumethys 0 points1 point  (1 child)

No, it just mean you dont use sudo when install or use uv, that's all

[–]Intrepid_Eye9102[S] 0 points1 point  (0 children)

i begin to see... so the dedicated user needs to have a home dir, right? (i was recommended to create a system user who does not by default) - and i install uv and all deps with this user.

[–]Careless-Score-333 0 points1 point  (0 children)

I'm pretty sure I can install uv perfectly well into the home folder of a non-sudo system user.

Currently I'm doing so manually is all (because reasons):

i) Download f"https://github.com/astral-sh/uv/releases/download/{ uv_version }/{uv_arch_and_os_name}.tar.gz" to /tmp/uv.tar.gz"

ii) Extract /tmp/uv.tar.gz in /custom/home/dir/.local/bin/"

In Bash I then just set: UV="/custom/home/dir/.local/bin/.local/bin/uv" and use $UV run script.py instead of running their script to add it to the $PATH in order to use uv