Skip to content

Instantly share code, notes, and snippets.

@fepegar
Created May 26, 2025 20:50
Show Gist options
  • Save fepegar/c8b9cc269b1f1ffd35bed1e6fee515da to your computer and use it in GitHub Desktop.
Save fepegar/c8b9cc269b1f1ffd35bed1e6fee515da to your computer and use it in GitHub Desktop.

Revisions

  1. fepegar created this gist May 26, 2025.
    63 changes: 63 additions & 0 deletions starship.toml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,63 @@
    [python]
    python_binary = ".venv/bin/python"

    [custom.uv-version]
    description = "The currently installed version of uv"
    shell = "bash"
    detect_files = [
    ".python-version",
    "Pipfile",
    "__init__.py",
    "pylock.toml",
    "pyproject.toml",
    "requirements.txt",
    "setup.py",
    "tox.ini",
    "uv.lock",
    ]
    style = "bold fg:#dffe7c"
    symbol = "by"
    command = '''
    if ! command -v uv >/dev/null; then
    exit 1
    fi
    uv_version=$(uv --version | awk '{print $2}')
    emoji=⚡️
    printf "%s v%s" "$emoji" "$uv_version"
    '''
    format = "$symbol [($output )]($style)"

    [custom.uv-lock]
    description = "Symbol representing the state of the lock file"
    shell = "bash"
    style = "bold fg:#cf67e2"
    detect_files = [
    ".python-version",
    "Pipfile",
    "__init__.py",
    "pylock.toml",
    "pyproject.toml",
    "requirements.txt",
    "setup.py",
    "tox.ini",
    "uv.lock",
    ]
    command = '''
    if ! command -v uv >/dev/null; then
    exit 1
    fi
    suffix=""
    if uv lock --check-exists >/dev/null; test $? -eq 2; then
    suffix="?"
    elif uv lock --check >/dev/null; test $? -eq 2; then
    suffix="!"
    fi
    if [ -n "$suffix" ]; then
    printf ["$suffix"]
    fi
    '''
    format = "[($output )]($style)"