amend windows installer
Browse files- fetch.py +12 -1
- pyproject.toml +1 -1
fetch.py
CHANGED
@@ -56,11 +56,22 @@ async def log_request(request: Request, call_next: Any):
|
|
56 |
|
57 |
@app.get("/")
|
58 |
def read_root(request: Request):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
query_params = dict(request.query_params)
|
60 |
py_ver = query_params.pop("python", "3.12")
|
61 |
if "Windows" in request.headers.get("user-agent"):
|
62 |
pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.ps1"
|
63 |
-
script = [
|
|
|
|
|
|
|
64 |
else:
|
65 |
pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh"
|
66 |
script = [f"curl -fsSL {pup_url} | bash -s {py_ver}"]
|
|
|
56 |
|
57 |
@app.get("/")
|
58 |
def read_root(request: Request):
|
59 |
+
"""Main URL returning an executable installer script.
|
60 |
+
|
61 |
+
Query parameters can be used to install specific things, e.g.
|
62 |
+
curl -fsSL "https://pup-py-fetch.hf.space?python=3.11&pixi=marimo&myenv=cowsay,duckdb"
|
63 |
+
|
64 |
+
Package specs "duckdb>=1.1" are not supported.
|
65 |
+
"""
|
66 |
+
|
67 |
query_params = dict(request.query_params)
|
68 |
py_ver = query_params.pop("python", "3.12")
|
69 |
if "Windows" in request.headers.get("user-agent"):
|
70 |
pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.ps1"
|
71 |
+
script = [
|
72 |
+
f"$pup_ps1 = (iwr -useb {pup_url}).Content",
|
73 |
+
f"& ([scriptblock]::Create($pup_ps1)) {py_ver}",
|
74 |
+
]
|
75 |
else:
|
76 |
pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh"
|
77 |
script = [f"curl -fsSL {pup_url} | bash -s {py_ver}"]
|
pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[project]
|
2 |
name = "fetch"
|
3 |
-
version = "0.3.
|
4 |
description = "Puppy Installer"
|
5 |
authors = [
|
6 |
{ name = "Alex Kislukhin" }
|
|
|
1 |
[project]
|
2 |
name = "fetch"
|
3 |
+
version = "0.3.1"
|
4 |
description = "Puppy Installer"
|
5 |
authors = [
|
6 |
{ name = "Alex Kislukhin" }
|