pup-py commited on
Commit
04d1a17
·
1 Parent(s): 058dfe9

some explanations; exclude HF queries from constructing pup recipe

Browse files
Files changed (2) hide show
  1. fetch.py +11 -1
  2. pyproject.toml +1 -1
fetch.py CHANGED
@@ -75,9 +75,11 @@ def read_root(request: Request):
75
  f"$pup_ps1 = (iwr -useb {pup_url}).Content",
76
  f"& ([scriptblock]::Create($pup_ps1)) {py_ver}",
77
  ]
 
78
  else:
79
  pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh"
80
  script = [f"curl -fsSL {pup_url} | bash -s {py_ver}"]
 
81
 
82
  pixi_packages = query_params.pop("pixi", "")
83
  if pixi_packages:
@@ -86,10 +88,18 @@ def read_root(request: Request):
86
 
87
  # remaining query params are venvs
88
  for venv, uv_packages in query_params.items():
 
 
89
  for pkg in uv_packages.split(","):
90
  script.append(f"pup add {venv} {pkg}")
91
 
92
- script.append("# script ends here\n")
 
 
 
 
 
 
93
  return PlainTextResponse("\n".join(script))
94
 
95
 
 
75
  f"$pup_ps1 = (iwr -useb {pup_url}).Content",
76
  f"& ([scriptblock]::Create($pup_ps1)) {py_ver}",
77
  ]
78
+ hint = f"""iex (iwr "{request.url}").Content"""
79
  else:
80
  pup_url = "https://raw.githubusercontent.com/liquidcarbon/puppy/main/pup.sh"
81
  script = [f"curl -fsSL {pup_url} | bash -s {py_ver}"]
82
+ hint = f"""curl -fsSL "{request.url}" | bash"""
83
 
84
  pixi_packages = query_params.pop("pixi", "")
85
  if pixi_packages:
 
88
 
89
  # remaining query params are venvs
90
  for venv, uv_packages in query_params.items():
91
+ if venv in ["logs"]:
92
+ continue
93
  for pkg in uv_packages.split(","):
94
  script.append(f"pup add {venv} {pkg}")
95
 
96
+ script.extend(
97
+ [
98
+ "# 🐶 scripts end here; if you like what you see, copy-paste this recipe, or run like so:",
99
+ f"# {hint}",
100
+ "# to learn more, visit https://github.com/liquidcarbon/puppy\n",
101
+ ]
102
+ )
103
  return PlainTextResponse("\n".join(script))
104
 
105
 
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [project]
2
  name = "fetch"
3
- version = "0.3.2"
4
  description = "Puppy Installer"
5
  authors = [
6
  { name = "Alex Kislukhin" }
 
1
  [project]
2
  name = "fetch"
3
+ version = "0.3.3"
4
  description = "Puppy Installer"
5
  authors = [
6
  { name = "Alex Kislukhin" }