Skip to main content

Make a note about only using venvs

ID
3d38821
date
2023-11-26 03:00:25+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
d187634
message
Make a note about only using venvs
changed files
2 files, 12 additions, 1 deletion

Changed files

README.md (1493) → README.md (1816)

diff --git a/README.md b/README.md
index 030a51f..3b984dc 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,15 @@ To set up this repo on a new computer, I run the following commands in a Fish sh
     $ source .venv/bin/activate.fish
     $ pip install -r requirements.txt
     ```
+
+3.  Add some global pip config to [prevent installing anything outside virtual environments](https://blog.glyph.im/2023/08/get-your-mac-python-from-python-dot-org.html#and-always-use-virtual-environments):
+
+    ```console
+    $ mkdir -p ~/.pip
+    $ echo -e "[global]\nrequire-virtualenv = true" > ~/.pip/pip.conf
+    ```
     
-3.  Install my Fish config, so Fish knows where to find all these scripts:
+4.  Install my Fish config, so Fish knows where to find all these scripts:
 
     ```console
     $ ln -s ~/repos/scripts/config.fish ~/.config/fish/config.fish

config.fish (2191) → config.fish (2311)

diff --git a/config.fish b/config.fish
index c5234a6..d52f058 100644
--- a/config.fish
+++ b/config.fish
@@ -18,6 +18,10 @@ set -g -x fish_greeting ''
 set -x fish_function_path ~/repos/scripts/fish_functions $fish_function_path
 
 
+# Add any extra directories to my PATH variable.
+fish_add_path /Library/Frameworks/Python.framework/Versions/3.12/bin
+
+
 # This tells fish to run a couple of functions as event handlers --
 # that is, to run a function when a variable changes or something similar.
 # These functions can't be autoloaded.