3 ms·
and pipx for managing python "apps" like youtube-dl, ipython, meson, ... https://pipxproject.github.io/pipx/ https://pipxproject.github.io/pipx/
by ducktective 6y ago
and pipx for managing python "apps" like youtube-dl, ipython, meson, ...
https://pipxproject.github.io/pipx/ https://pipxproject.github.io/pipx/
- duggan 6y agoI’ve been doing a manual version of this for years, creating a shell shim wrapping a venv for cli tools. This is much neater, thanks!
- mike-cardwell 6y agoI prefer my system for running youtube-dl in an isolated environment without having to install all of its dependencies on the host. Ansible writes a bash script at ~/bin/youtube-dl containing: #!/usr/bin/env bash set -e IMAGE_NAME="grepular/youtube-dl" # Build the image if it does not exist if [[ $(podman images --filter "reference=$IMAGE_NAME" -q) == "" ]]; then podman build -t "$IMAGE_NAME" -<<EOF >&2 FROM python:3-slim RUN python3 -m pip --no-cache-dir install youtube_dl ENTRYPOINT ["youtube-dl"] EOF fi podman run --net host -i --rm -v "$PWD:/app" -w /app "$IMAGE_NAME" "$@"
- ORioN63 6y agoQQ, aren't the created files owned by root?
- mike-cardwell 6y agoNope. I'm using podman rather than docker so they're owned by the user that runs the script. The root user isn't involved. If I were using docker, I'd add `-u "$(id -u):$(id -g)"` to the docker args to deal with that issue.
- wp381640 6y agoPipx is pretty much that - installs a package into its own venv and links script entry points to .local/bin