Created
October 5, 2024 23:30
-
-
Save bluss/9f52215f647028321bb063b1d866e227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" == +* ]]; then | |
PYVERSION=(-p "${1#+}") | |
shift | |
else | |
PYVERSION=() | |
fi | |
UVARGS=( "$@" ) | |
IPYARGS=() | |
for i in "${!UVARGS[@]}"; do | |
if [[ "${UVARGS[$i]}" = "--" ]]; then | |
IPYARGS=( "${UVARGS[@]:$i+1}" ) | |
UVARGS=( "${UVARGS[@]:0:$i}" ) | |
break | |
fi | |
done | |
exec uv run "${PYVERSION[@]}" --with ipython "${UVARGS[@]}" ipython "${IPYARGS[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uvipython +3.11
to run with particular versionuvipython <uv args> -- <ipython args>