Your new best friend will help you set up python, with a little help from some powerful friends.
TLDR: pup fetch
β pip install
. But wait, there's more!
π fast cross-platform CLI (Bash, Windows) for managing python projects and environments
𫧠base layer python is completely isolated from OS or other pre-existing python - everything in one folder, nothing goes on PATH
π₯ generates jupyter kernels properly linked to virtual environments
π generates, executes notebooks from CLI
πͺ scriptable deployments - from zero to any python app in a single Bash or Powershell script
pup-514-2.mp4
Puppy is a cute, transparent wrapper of pixi and uv, for best of both worlds.
LOL WHY?
$ pup --help
Usage: pup.py [OPTIONS] COMMAND [ARGS]...
Call pup and friends for all your python needs.
Options:
--help Show this message and exit.
Commands:
drop Drop (uninstall) packages with uv.
fetch Fetch (install) packages with uv.
kernel Interactively create new ipython kernel linked to πΆ's environment.
list List packages.
new Create a new virtual environment in <WHERE> folder.
play Generate, execute, or open jupyter notebook with added code cells.
which Show πΆ's current home.
To start, you need only curl
/iwr
; pup and friends will handle the rest.
Start in an empty folder. Everything that puppy brings is fetched into this one folder, in complete isolation from system or any other python on your system.
Nothing (except Pixi) goes on PATH.
The first command installs Pixi, Pup, and Python.
curl -fsSL https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh | bash
The second command creates alias pup
in the current shell by sourcing the last line of the install script.
. <(curl -fsSL https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh | tail -1)
iex (iwr https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.ps1).Content
iex ((iwr https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.ps1).Content -split "`n")[-2]
Tip
Be careful with sourcing random scripts from the internet! Inspect that last line to ensure you trust it: pup.sh | pup.ps1
With pup
alias:
$ pup which
[2024-05-13 18:54:12] πΆ says: home is /mnt/c/Users/a/Desktop/code/puppy513
PS C:\Users\a\puppytest> pup which
[2024-05-13 18:48:16] πΆ says: home is C:\Users\a\puppytest
Note
If you don't set the pup
alias, Bash ./pup.py
will work thanks to a shebang; but for Powershell you'll have to find python executable and run .\.pixi\envs\default\python.exe pup.py which
.
A pup/py home is defined by one and only one python executable, which is managed by pixi,
along with tools like uv, jupyter, hatch, pytest, and conda-managed packages.
We use home-specific tools through a pixi shell from anywhere within the folder,
e.g. pixi run python
, pixi run jupyter
, or by calling their absolute paths.
βββ puphome
β βββ env1
β β βββ .venv
β β βββ pyproject.toml
β βββ env2
β β βββ .venv
β β βββ pyproject.toml
β βββ pixi.toml
β βββ pup.py
βββ pup311torch
β βββ env3
β βββ env4
βββ pup313beta
βββ env5
ββββββββββββββββββββββββββββ
Illustration of pup/py homes
curl -fsSL https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh | bash -s 3.11
& ([scriptblock]::Create((iwr -useb https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.ps1).Content)) 3.11
Check out usage examples and workflows. Note that Pixi and uv are still v0 and breaking changes may sneak in [example], which I'll try address promptly.
Screencast.from.2024-05-24.15-35-33.webm
pup build
(via compile, freeze, etc.)pup swim
(build Dockerfiles)
- the first iteration was a big Bash script
Thanks for checking out this repo. Hope you try it out and like it! Feedback, discussion, and βs are welcome!