shellscripts 0.25.0__py3-none-any.whl → 0.25.1__py3-none-any.whl

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.
shell_scripts/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.25.0"
1
+ __version__ = "0.25.1"
2
2
 
3
3
  from .core import main # noqa: F401
4
4
 
shell_scripts/config.py CHANGED
@@ -25,9 +25,9 @@ from shell_scripts.utils import print_warn
25
25
  # @satisfies DES-011, DES-012
26
26
  DEFAULT_RUNTIME_CONFIG: dict[str, Any] = {
27
27
  "management": {
28
- "upgrade": "uv tool install shellscripts --force",
28
+ "upgrade": "uv tool install shellscripts",
29
29
  "upgrade_develop": (
30
- "uv tool install shellscripts --force "
30
+ "uv tool install shellscripts "
31
31
  "--from git+https://github.com/Ogekuri/shellScripts.git@{tag}"
32
32
  ),
33
33
  "uninstall": "uv tool uninstall shellscripts",
shell_scripts/core.py CHANGED
@@ -3,9 +3,10 @@
3
3
 
4
4
  @details Provides global help rendering, management command execution
5
5
  (`--version`, `--ver`, `--upgrade`, `--uninstall`, `--write-config`,
6
- `--develop`/`--dev` upgrade selector), runtime
7
- configuration bootstrap, and subcommand delegation to lazily imported modules.
8
- @satisfies PRJ-001, PRJ-002, PRJ-003, REQ-001, REQ-002, REQ-003, REQ-004, REQ-005, REQ-045, REQ-046, REQ-048, REQ-049, REQ-050, REQ-051, REQ-052, REQ-053, REQ-054, REQ-056, REQ-064, REQ-065, REQ-066, REQ-068, REQ-069, REQ-075, REQ-076, REQ-077, REQ-078
6
+ `--develop`/`--dev` upgrade selector, `--force` forced-reinstall selector),
7
+ runtime configuration bootstrap, and subcommand delegation to lazily imported
8
+ modules.
9
+ @satisfies PRJ-001, PRJ-002, PRJ-003, REQ-001, REQ-002, REQ-003, REQ-004, REQ-005, REQ-045, REQ-046, REQ-048, REQ-049, REQ-050, REQ-051, REQ-052, REQ-053, REQ-054, REQ-056, REQ-064, REQ-065, REQ-066, REQ-068, REQ-069, REQ-075, REQ-076, REQ-077, REQ-078, REQ-087, REQ-088, REQ-089, REQ-090
9
10
  """
10
11
 
11
12
  import sys
@@ -37,6 +38,14 @@ PROGRAM = "shellscripts"
37
38
  # @satisfies REQ-066
38
39
  HELP_COMMAND_COLUMN_WIDTH = 16
39
40
 
41
+ ## @var FORCED_REINSTALL_OPTIONS
42
+ # @brief Option suffix appended to upgrade commands when `--force` is active.
43
+ # @details Standard forced-reinstall options for `uv tool install`: replace
44
+ # the installed tool entry, reinstall the package, and refresh cached remote
45
+ # metadata so the upgrade performs a full re-download and reinstallation.
46
+ # @satisfies REQ-088, REQ-089
47
+ FORCED_REINSTALL_OPTIONS = "--force --reinstall --refresh"
48
+
40
49
  ## @var HELP_SECTION_COMMANDS
41
50
  # @brief Ordered command groups for global help rendering.
42
51
  # @details Defines deterministic section order and command-token order used by
@@ -142,6 +151,10 @@ def print_help(command_name=None):
142
151
  " --dev - With --upgrade: upgrade from the latest GitHub release tag"
143
152
  )
144
153
  print(" instead of PyPI (alias: --develop).")
154
+ print(
155
+ " --force - With --upgrade: force download and complete reinstallation"
156
+ )
157
+ print(" (appends --force --reinstall --refresh).")
145
158
  print(
146
159
  f" --uninstall - Uninstall {PROGRAM} on Linux; print manual command elsewhere."
147
160
  )
@@ -181,18 +194,21 @@ def _build_develop_upgrade_command(latest_tag: str) -> str:
181
194
  return template.replace("{tag}", latest_tag)
182
195
 
183
196
 
184
- def do_upgrade(develop: bool = False) -> int:
197
+ def do_upgrade(develop: bool = False, force: bool = False) -> int:
185
198
  """@brief Execute Linux-only upgrade command resolved from runtime config.
186
199
 
187
200
  @details Reads management command string from runtime config key
188
201
  `management.upgrade` (PyPI default) or, when `develop` is set, resolves
189
202
  the latest GitHub release tag and composes the tag-pinned upgrade command;
190
- executes it on Linux via shell invocation and prints the manual fallback
191
- command on non-Linux systems.
192
- @param develop {bool} Force upgrade from the latest GitHub release tag.
203
+ appends ` --force --reinstall --refresh` to the resolved command when
204
+ `force` is set; executes the composed command on Linux via shell
205
+ invocation and prints the manual fallback command on non-Linux systems.
206
+ Complexity O(n) over the composed command string length.
207
+ @param develop {bool} Select upgrade from the latest GitHub release tag.
208
+ @param force {bool} Append forced-reinstall options to the upgrade command.
193
209
  @return {int} `1` when develop tag resolution fails; subprocess return code
194
210
  on Linux; `0` on non-Linux fallback.
195
- @satisfies REQ-004, REQ-076, REQ-078, REQ-045, REQ-056
211
+ @satisfies REQ-004, REQ-076, REQ-078, REQ-087, REQ-088, REQ-089, REQ-045, REQ-056
196
212
  """
197
213
 
198
214
  if develop:
@@ -204,6 +220,8 @@ def do_upgrade(develop: bool = False) -> int:
204
220
  install_cmd = _build_develop_upgrade_command(latest_tag)
205
221
  else:
206
222
  install_cmd = get_management_command("upgrade")
223
+ if force:
224
+ install_cmd = f"{install_cmd} {FORCED_REINSTALL_OPTIONS}"
207
225
  if is_linux():
208
226
  require_shell_command_executables(install_cmd)
209
227
  print(f"Upgrading {PROGRAM}...")
@@ -261,12 +279,14 @@ def main():
261
279
  @details Performs runtime OS detection, update check, runtime configuration
262
280
  load, and argument dispatch through management flags (`--version` prints
263
281
  installed plus PyPI/GitHub latest versions; `--upgrade` upgrades from PyPI
264
- or, with `--develop`/`--dev`, from the latest GitHub release tag) and
265
- subcommands, then restores terminal raw/cbreak and disables legacy+xterm
282
+ or, with `--develop`/`--dev`, from the latest GitHub release tag; `--force`
283
+ appends forced-reinstall options to the selected upgrade command; bare
284
+ `--develop`/`--dev`/`--force` selectors are rejected) and subcommands,
285
+ then restores terminal raw/cbreak and disables legacy+xterm
266
286
  mouse-tracking modes (`?9l`, `?1000l`, `?1001l`, `?1002l`, `?1003l`,
267
287
  `?1004l`, `?1005l`, `?1006l`, `?1007l`, `?1015l`, `?1016l`) before exit.
268
288
  @return {int} Process-compatible return code for caller (`sys.exit`).
269
- @satisfies PRJ-001, REQ-001, REQ-002, REQ-003, REQ-004, REQ-005, REQ-045, REQ-046, REQ-047, REQ-048, REQ-049, REQ-050, REQ-051, REQ-052, REQ-053, REQ-054, REQ-064, REQ-065, REQ-066, REQ-068, REQ-069, REQ-075, REQ-076, REQ-077, REQ-078
289
+ @satisfies PRJ-001, REQ-001, REQ-002, REQ-003, REQ-004, REQ-005, REQ-045, REQ-046, REQ-047, REQ-048, REQ-049, REQ-050, REQ-051, REQ-052, REQ-053, REQ-054, REQ-064, REQ-065, REQ-066, REQ-068, REQ-069, REQ-075, REQ-076, REQ-077, REQ-078, REQ-087, REQ-088, REQ-089, REQ-090
270
290
  """
271
291
  saved_tty = capture_terminal_state()
272
292
  try:
@@ -289,12 +309,17 @@ def main():
289
309
 
290
310
  if first_arg == "--upgrade":
291
311
  develop = any(arg in ("--develop", "--dev") for arg in args[1:])
292
- return do_upgrade(develop=develop)
312
+ force = "--force" in args[1:]
313
+ return do_upgrade(develop=develop, force=force)
293
314
 
294
315
  if first_arg in ("--develop", "--dev"):
295
316
  print_error("--develop/--dev must be used together with --upgrade.")
296
317
  return 1
297
318
 
319
+ if first_arg == "--force":
320
+ print_error("--force must be used together with --upgrade.")
321
+ return 1
322
+
298
323
  if first_arg == "--uninstall":
299
324
  return do_uninstall()
300
325
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shellscripts
3
- Version: 0.25.0
3
+ Version: 0.25.1
4
4
  Summary: Execute useful shell scripts via an uvx-compatible CLI interface.
5
5
  Author: Francesco Rolando
6
6
  License-Expression: GPL-3.0-only
@@ -31,7 +31,7 @@ Dynamic: license-file
31
31
  > * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
32
32
  > * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
33
33
 
34
- # s/shellScripts (0.25.0)
34
+ # s/shellScripts (0.25.1)
35
35
 
36
36
  <p align="center">
37
37
  <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
@@ -106,6 +106,12 @@ Upgrade to the latest published PyPI release:
106
106
  s --upgrade
107
107
  ```
108
108
 
109
+ Force a complete re-download and reinstallation by appending the forced-reinstall options (`--force --reinstall --refresh`) to the configured upgrade command:
110
+
111
+ ```bash
112
+ s --upgrade --force
113
+ ```
114
+
109
115
 
110
116
  ### Run Without Installing (uvx)
111
117
 
@@ -145,6 +151,12 @@ s --upgrade --dev
145
151
  s --upgrade --develop
146
152
  ```
147
153
 
154
+ Add `--force` to force a complete re-download and reinstallation of the tagged release:
155
+
156
+ ```bash
157
+ s --upgrade --develop --force
158
+ ```
159
+
148
160
 
149
161
  ## Management Commands
150
162
 
@@ -161,6 +173,7 @@ Built-in management flags:
161
173
  - `--help` : show full help or command help (`shellscripts --help <command>`).
162
174
  - `--version` / `--ver` : print the installed version plus the latest versions available on PyPI and GitHub.
163
175
  - `--upgrade` : run the configured upgrade command automatically on Linux (installs the latest PyPI release by default), otherwise print the manual command.
176
+ - `--upgrade --force` : force download and complete reinstallation by appending `--force --reinstall --refresh` to the `--upgrade` or `--upgrade --dev`/`--upgrade --develop` command.
164
177
  - `--upgrade --dev` / `--upgrade --develop` : upgrade from the latest tagged GitHub release instead of PyPI, regardless of its source branch.
165
178
  - `--uninstall` : run configured uninstall command automatically on Linux, otherwise print the manual command.
166
179
  - `--write-config` : write the default runtime configuration file.
@@ -1,7 +1,7 @@
1
- shell_scripts/__init__.py,sha256=sWpk4dCD9V5rWwB5mF0ld3eINn_1tk9T2otaWU4Q7z0,96
1
+ shell_scripts/__init__.py,sha256=XWnbBP7_a1CX7d2RbumNzRbD9edw5GSlnaqo-JXSLZs,96
2
2
  shell_scripts/__main__.py,sha256=-wEmwKTfeY5TphAH82E38XRPoB4KT5QDLDgRZz84PTs,83
3
- shell_scripts/config.py,sha256=YUs8QWsZ31lJPrMpFqvn7YLQdseQnlaiu7OXcXsKdEw,12640
4
- shell_scripts/core.py,sha256=Fcu8wGiBsLhouK4VSuVXsacT4f78HnXrm1LzwCeNkUs,11197
3
+ shell_scripts/config.py,sha256=bOFq3UxuTHPOqPc7lXLqri7f6NTaF19Mx1Q0i4rY3Dg,12624
4
+ shell_scripts/core.py,sha256=_xMg7u-g774Z-BpR00JbUHuRevz-CziutS9SnNlpEXw,12619
5
5
  shell_scripts/utils.py,sha256=ckIJRJ_F7XTu_SqpFu_vI_70xNOmVM3S48YiTzxpO7o,14115
6
6
  shell_scripts/version_check.py,sha256=KVXVksy-T5V6rAYAnWACzv5MHi2dnrsYiNYg_yW0Eks,13184
7
7
  shell_scripts/commands/__init__.py,sha256=VoB5ucIdlUmcVdYV1JNgPvGBJU3aKPZMMMmY20Kjf5E,3682
@@ -37,9 +37,9 @@ shell_scripts/commands/video2h265.py,sha256=Sr_UWGz_V77x4anmuy8kiWZv5I_AOFlV0WDn
37
37
  shell_scripts/commands/view_cmd.py,sha256=qHEivQHZpZCTE3VSFP1ay2SuqgancQlEKxJcKtyeqNA,1827
38
38
  shell_scripts/commands/vscode_cmd.py,sha256=Rkcjt5A1HMzqJoh2Yz9VRGoLP-L3qpRO5hkcSrzOmvA,1461
39
39
  shell_scripts/commands/vsinsider_cmd.py,sha256=KTTv1cVpJO-u1ktxOE0W_o4AAmz20pAvkDtyhpU9XBg,1548
40
- shellscripts-0.25.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
41
- shellscripts-0.25.0.dist-info/METADATA,sha256=-3I296fPkLpOPm5hgc1Qez5liP4AU7KfnK0WkkR0rZg,10771
42
- shellscripts-0.25.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
43
- shellscripts-0.25.0.dist-info/entry_points.txt,sha256=9ICAgH87fxHBzi3f6JXIVcsPWzAKsCh4_1xS8JThQ0M,85
44
- shellscripts-0.25.0.dist-info/top_level.txt,sha256=7bDVqjcR5CfCCArCP4X4e9gYJ-ua8z-GfQeHbAo8rCY,14
45
- shellscripts-0.25.0.dist-info/RECORD,,
40
+ shellscripts-0.25.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
41
+ shellscripts-0.25.1.dist-info/METADATA,sha256=9W8Pw-maYRhZbciK6cQeITC95ocy6QZDsS_aQzI_08E,11279
42
+ shellscripts-0.25.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
43
+ shellscripts-0.25.1.dist-info/entry_points.txt,sha256=9ICAgH87fxHBzi3f6JXIVcsPWzAKsCh4_1xS8JThQ0M,85
44
+ shellscripts-0.25.1.dist-info/top_level.txt,sha256=7bDVqjcR5CfCCArCP4X4e9gYJ-ua8z-GfQeHbAo8rCY,14
45
+ shellscripts-0.25.1.dist-info/RECORD,,