Skip to main content

Let’s use pipx to install global deps instead

ID
3290ce8
date
2024-04-11 11:21:10+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
39c4c42
message
Let's use pipx to install global deps instead
changed files
3 files, 21 additions, 27 deletions

Changed files

config.fish (7232) → config.fish (6697)

diff --git a/config.fish b/config.fish
index 6124895..cce9a36 100644
--- a/config.fish
+++ b/config.fish
@@ -46,10 +46,6 @@ function prepend_to_path
     end
 end
 
-prepend_to_path /opt/homebrew/bin
-prepend_to_path /opt/homebrew/opt/ruby/bin
-prepend_to_path /opt/homebrew/lib/ruby/gems/3.3.0/gems/jekyll-4.3.3/exe
-
 prepend_to_path /Library/Frameworks/Python.framework/Versions/3.12/bin
 
 prepend_to_path ~/repos/scripts
@@ -63,6 +59,14 @@ prepend_to_path ~/repos/scripts/terraform
 prepend_to_path ~/repos/scripts/text
 prepend_to_path ~/repos/scripts/web
 
+# Paths for Ruby and bundler
+prepend_to_path /opt/homebrew/bin
+prepend_to_path /opt/homebrew/opt/ruby/bin
+prepend_to_path /opt/homebrew/lib/ruby/gems/3.3.0/bin
+
+# Path for Python tools installed with pipx
+prepend_to_path ~/.local/bin
+
 
 # This prevents me from installing packages with pip without being
 # in a virtualenv first.
@@ -162,23 +166,6 @@ function __create_python_script_alias
     end
 end
 
-function __create_python_module_alias
-    set module_name $argv[1]
-
-    # If we're in a virtualenv where this module is installed, we
-    # should prefer the virtualenv version over the version in scripts.
-    function $module_name --inherit-variable module_name
-        which $module_name >/dev/null 2>&1
-
-        if test $status -eq 0
-            set executable (which $module_name)
-            $executable $argv
-        else
-            ~/repos/scripts/.venv/bin/$module_name $argv
-        end
-    end
-end
-
 __create_bash_script_alias flickr/flapi.sh
 __create_bash_script_alias flickr/flphoto.sh
 __create_bash_script_alias text/pp_xml.sh
@@ -203,7 +190,3 @@ __create_python_script_alias text/noplaylist.py
 __create_python_script_alias text/sumsizes.py
 __create_python_script_alias web/download_instagram.py
 __create_python_script_alias web/yt-dlp.py
-
-__create_python_module_alias cog
-__create_python_module_alias datasette
-__create_python_module_alias keyring

requirements.in (362) → requirements.in (367)

diff --git a/requirements.in b/requirements.in
index 70b956d..f159521 100644
--- a/requirements.in
+++ b/requirements.in
@@ -19,6 +19,7 @@ naturalsort==1.5.1
 Pillow
 pillow_heif
 pip-tools
+pipx
 pygments
 pypdf
 pytest

requirements.txt (5018) → requirements.txt (5159)

diff --git a/requirements.txt b/requirements.txt
index cceaab9..e08a1fc 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,12 +2,14 @@
 # This file is autogenerated by pip-compile with Python 3.12
 # by the following command:
 #
-#    pip-compile requirements.in
+#    pip-compile
 #
 aiofiles==23.2.1
     # via datasette
 anyio==4.1.0
     # via httpx
+argcomplete==3.2.3
+    # via pipx
 asgi-csrf==0.9
     # via datasette
 asgiref==3.7.2
@@ -45,6 +47,7 @@ click==8.1.7
     #   datasette
     #   pip-tools
     #   sqlite-utils
+    #   userpath
     #   uvicorn
 click-default-group==1.2.4
     # via
@@ -147,6 +150,7 @@ packaging==23.2
     # via
     #   black
     #   build
+    #   pipx
     #   pytest
 pathspec==0.12.0
     # via black
@@ -160,8 +164,12 @@ pint==0.23
     # via datasette
 pip-tools==7.3.0
     # via -r requirements.in
+pipx==1.5.0
+    # via -r requirements.in
 platformdirs==4.1.0
-    # via black
+    # via
+    #   black
+    #   pipx
 pluggy==1.3.0
     # via
     #   datasette
@@ -245,6 +253,8 @@ urllib3==2.0.7
     #   botocore
     #   requests
     #   yt-dlp
+userpath==1.9.2
+    # via pipx
 uvicorn==0.25.0
     # via datasette
 websockets==12.0