This plugin contains portable Python 3.8 AppImage which can be used on host without python.
From xxh repo:
xxh +I xxh-plugin-prerun-python
From any repo:
xxh +I xxh-plugin-prerun-python+git+https://github.com/xxh/xxh-plugin-prerun-python
Connect:
xxh myhost +if
myhost> which python
/home/ubuntu/.xxh/.xxh/plugins/xxh-plugin-prerun-python/build/python/python
myhost> python
Python 3.8.2
>>>
myhost> pip install pandas
myhost> python
>>> import pandas
Packages location comply with hermetic principle and the same as used in xxh-shell-xonsh:
xxh command | pip packages home | user home |
---|---|---|
xxh myhost +s bash |
/home/user/.xxh/.local |
/home/user/.xxh |
xxh myhost +s bash +hhh '~' |
/home/user/.xxh/.local |
/home/user |
xxh myhost +s bash +hhh '~' +hhx '~' |
/home/user/.local |
/home/user |
xxh +RI xxh-plugin-prerun-sudo xxh-plugin-prerun-python
xxh myhost +s zsh +if
myhost> pip install fastapi uvicorn && mkdir api && cd api
myhost> echo -e 'from fastapi import FastAPI; app = FastAPI()\[email protected]("/")\ndef read_root():\n return {"xxh": "https://github.com/xxh/xxh"}' > main.py
myhost> xxh-sudo uvicorn main:app --reload --host 0.0.0.0 --port 80
INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
$ curl http://myhost/
{"xxh":"https://github.com/xxh/xxh"}