-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add documentation and test cases to support the documentation
- Loading branch information
1 parent
5278de8
commit c998658
Showing
5 changed files
with
215 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env -S pyvm pipx 3.12 run --path | ||
|
||
# /// script | ||
# dependencies = [ | ||
# "requests", | ||
# "rich", | ||
# ] | ||
# /// | ||
|
||
import requests | ||
from rich import print | ||
|
||
print(requests.get("https://httpbin.org").text) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
""":" | ||
set -euo pipefail | ||
|
||
PYTHON_VERSION="3.12" | ||
|
||
HERE="$( dirname -- "$( readlink -f -- "$0"; )"; )" | ||
PYVM="$HERE/pyvm" | ||
if [ ! -f "$PYVM" ]; then | ||
|
||
# define a function which selects curl or wget based on availability | ||
download() { | ||
if command -v curl &> /dev/null; then | ||
curl -s -L -o $1 $2 | ||
elif command -v wget &> /dev/null; then | ||
wget -q -O $1 $2 | ||
else | ||
echo "Neither curl nor wget found. Please install one of these packages." | ||
exit 1 | ||
fi | ||
} | ||
|
||
echo "Bootstrapping PyVM..." | ||
download $PYVM alextremblay.github.io/pyvm/pyvm.py | ||
chmod +x $PYVM | ||
|
||
fi | ||
|
||
exec "$PYVM" pipx $PYTHON_VERSION run --path "$0" "$@" | ||
""" | ||
# /// script | ||
# dependencies = [ | ||
# "requests", | ||
# "rich", | ||
# ] | ||
# /// | ||
import requests | ||
from rich import print | ||
print(requests.get("https://httpbin.org").text) |
This file contains 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