tony-cli 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tony_cli-0.3.1/src/tony_cli.egg-info → tony_cli-0.3.2}/PKG-INFO +1 -1
- {tony_cli-0.3.1 → tony_cli-0.3.2}/pyproject.toml +1 -1
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/install.py +51 -8
- {tony_cli-0.3.1 → tony_cli-0.3.2/src/tony_cli.egg-info}/PKG-INFO +1 -1
- {tony_cli-0.3.1 → tony_cli-0.3.2}/LICENSE +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/README.md +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/setup.cfg +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/__init__.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/agent.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/fonts/Favorit-Bold.woff2 +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/fonts/Favorit-Book.woff2 +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/fonts/Favorit-Regular.woff2 +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/fonts/FavoritMono-Medium.woff2 +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/fonts/FavoritMono-Regular.woff2 +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/viewer.css +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/assets/viewer.js +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/fonts.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/hosted.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/layout.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/page.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/payload.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/source/__init__.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/source/local.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli/uninstall.py +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli.egg-info/SOURCES.txt +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli.egg-info/dependency_links.txt +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli.egg-info/entry_points.txt +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli.egg-info/requires.txt +0 -0
- {tony_cli-0.3.1 → tony_cli-0.3.2}/src/tony_cli.egg-info/top_level.txt +0 -0
|
@@ -57,11 +57,18 @@ def uninstallCommand(kind):
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
def updateCommand(kind):
|
|
60
|
+
"""The upgrade, told to ignore its own cache.
|
|
61
|
+
|
|
62
|
+
Every one of these caches the index, and a cache that is minutes stale
|
|
63
|
+
resolves to the version before the one just released — then reports
|
|
64
|
+
"already at latest" and exits 0. An update that runs once a month should
|
|
65
|
+
pay for a fresh lookup rather than confidently do nothing.
|
|
66
|
+
"""
|
|
60
67
|
if kind == "uv":
|
|
61
|
-
return ["uv", "tool", "upgrade", PKG]
|
|
68
|
+
return ["uv", "tool", "upgrade", "--refresh", PKG]
|
|
62
69
|
if kind == "pipx":
|
|
63
|
-
return ["pipx", "upgrade", PKG]
|
|
64
|
-
return [sys.executable, "-m", "pip", "install", "--upgrade", PKG]
|
|
70
|
+
return ["pipx", "upgrade", PKG, "--pip-args=--no-cache-dir"]
|
|
71
|
+
return [sys.executable, "-m", "pip", "install", "--upgrade", "--no-cache-dir", PKG]
|
|
65
72
|
|
|
66
73
|
|
|
67
74
|
def installedVersion():
|
|
@@ -73,6 +80,27 @@ def installedVersion():
|
|
|
73
80
|
return None
|
|
74
81
|
|
|
75
82
|
|
|
83
|
+
def installedOnDisk():
|
|
84
|
+
"""The version the environment's metadata records, re-read from disk.
|
|
85
|
+
|
|
86
|
+
`installedVersion` answers from what this interpreter imported at startup,
|
|
87
|
+
which is precisely the version an upgrade just replaced. The dist-info
|
|
88
|
+
directory on disk is the only thing in this process that knows what is
|
|
89
|
+
actually installed now.
|
|
90
|
+
"""
|
|
91
|
+
import glob
|
|
92
|
+
import sysconfig
|
|
93
|
+
|
|
94
|
+
purelib = sysconfig.get_paths().get("purelib")
|
|
95
|
+
if not purelib:
|
|
96
|
+
return None
|
|
97
|
+
found = glob.glob(os.path.join(purelib, "tony_cli-*.dist-info"))
|
|
98
|
+
if not found:
|
|
99
|
+
return None
|
|
100
|
+
name = os.path.basename(sorted(found)[-1])
|
|
101
|
+
return name[len("tony_cli-"):-len(".dist-info")] or None
|
|
102
|
+
|
|
103
|
+
|
|
76
104
|
def latestVersion(timeout=10):
|
|
77
105
|
"""The newest version PyPI serves, or None if it cannot be asked.
|
|
78
106
|
|
|
@@ -128,11 +156,26 @@ def update(argv=()):
|
|
|
128
156
|
print(f"tony: {kind} could not update tony.", file=sys.stderr)
|
|
129
157
|
return result.returncode
|
|
130
158
|
|
|
131
|
-
#
|
|
132
|
-
#
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
|
|
159
|
+
# What PyPI calls newest is not what just landed on this machine. An
|
|
160
|
+
# installer resolving against a stale index cache prints "already at latest"
|
|
161
|
+
# for a version that is not the latest, and exits 0 — reporting the upgrade
|
|
162
|
+
# from PyPI's answer turns that into a confident lie.
|
|
163
|
+
after = installedOnDisk()
|
|
164
|
+
|
|
165
|
+
if after and before and after == before:
|
|
166
|
+
print(
|
|
167
|
+
f"\ntony: still {after} — {kind} did not install a newer version, "
|
|
168
|
+
f"though PyPI offers {latest or 'a newer one'}.\n"
|
|
169
|
+
f" Try again in a minute; a release takes a moment to reach "
|
|
170
|
+
f"every mirror.\n",
|
|
171
|
+
file=sys.stderr,
|
|
172
|
+
)
|
|
173
|
+
return 1
|
|
174
|
+
|
|
175
|
+
if after and before:
|
|
176
|
+
print(f"\ntony: updated {before} -> {after}.")
|
|
177
|
+
elif after:
|
|
178
|
+
print(f"\ntony: now on {after}.")
|
|
136
179
|
else:
|
|
137
180
|
print("\ntony: the installer finished. Check it with `tony --version`.")
|
|
138
181
|
return 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|