Skip to content

Instantly share code, notes, and snippets.

@jaysin586
jaysin586 / pyenv_update.sh
Last active November 18, 2024 21:21
PyENV Update Script
# A function to update the python version in a pyenv virtualenv
# Usage: pyenv_update <version>
# Example: pyenv_update 3.9.7
# Note: This will remove the virtualenv and recreate it.
pyenv_update() {
PYENV_FILE=.python-version
PYENV_FREEZE_FILE=.requirements-lock.txt
# Check if version argument is provided
if [ -z "$1" ]; then
@jaysin586
jaysin586 / pip tools helpers
Last active November 18, 2024 21:39
Pip Tools helper functions
# Compile all requirements.in files in current directory
# Usage: pipcompile [--quiet|-q] [--verbose|-v]
pipcompile() {
local quiet=false
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--quiet|-q) quiet=true ;;
--verbose|-v) quiet=false ;;