cave-cli 3.5.2__tar.gz → 3.5.4__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.
Files changed (43) hide show
  1. {cave_cli-3.5.2/cave_cli.egg-info → cave_cli-3.5.4}/PKG-INFO +1 -1
  2. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/create.py +1 -1
  3. cave_cli-3.5.4/cave_cli/commands/update.py +80 -0
  4. {cave_cli-3.5.2 → cave_cli-3.5.4/cave_cli.egg-info}/PKG-INFO +1 -1
  5. {cave_cli-3.5.2 → cave_cli-3.5.4}/pyproject.toml +1 -1
  6. cave_cli-3.5.2/cave_cli/commands/update.py +0 -57
  7. {cave_cli-3.5.2 → cave_cli-3.5.4}/LICENSE +0 -0
  8. {cave_cli-3.5.2 → cave_cli-3.5.4}/NOTICE.md +0 -0
  9. {cave_cli-3.5.2 → cave_cli-3.5.4}/README.md +0 -0
  10. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/__init__.py +0 -0
  11. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/cli.py +0 -0
  12. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/__init__.py +0 -0
  13. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/doctor.py +0 -0
  14. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/kill.py +0 -0
  15. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/list_cmd.py +0 -0
  16. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/list_versions.py +0 -0
  17. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/prettify.py +0 -0
  18. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/purge.py +0 -0
  19. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/reset.py +0 -0
  20. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/run.py +0 -0
  21. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/sync_cmd.py +0 -0
  22. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/test.py +0 -0
  23. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/theme.py +0 -0
  24. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/uninstall.py +0 -0
  25. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/upgrade.py +0 -0
  26. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/commands/version.py +0 -0
  27. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/__init__.py +0 -0
  28. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/cache.py +0 -0
  29. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/constants.py +0 -0
  30. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/display.py +0 -0
  31. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/docker.py +0 -0
  32. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/env.py +0 -0
  33. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/git.py +0 -0
  34. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/logger.py +0 -0
  35. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/net.py +0 -0
  36. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/subprocess.py +0 -0
  37. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/sync.py +0 -0
  38. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli/utils/validate.py +0 -0
  39. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli.egg-info/SOURCES.txt +0 -0
  40. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli.egg-info/dependency_links.txt +0 -0
  41. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli.egg-info/entry_points.txt +0 -0
  42. {cave_cli-3.5.2 → cave_cli-3.5.4}/cave_cli.egg-info/top_level.txt +0 -0
  43. {cave_cli-3.5.2 → cave_cli-3.5.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cave_cli
3
- Version: 3.5.2
3
+ Version: 3.5.4
4
4
  Summary: CLI for creating and managing Docker-based CAVE web applications.
5
5
  Author-email: MIT-CAVE <cave-contact@mit.edu>
6
6
  License: Apache-2.0
@@ -9,7 +9,7 @@ from cave_cli.commands.reset import reset
9
9
  from cave_cli.commands.run import run_cave
10
10
  from cave_cli.utils.constants import HTTPS_URL
11
11
  from cave_cli.utils.display import print_section, step_done, step_fail, step_start
12
- from cave_cli.utils.docker import build_image, check_docker, generate_secret_key
12
+ from cave_cli.utils.docker import build_image, generate_secret_key
13
13
  from cave_cli.utils.env import create_env_interactive
14
14
  from cave_cli.utils.git import add, branch_rename, clone, commit, init
15
15
  from cave_cli.utils.logger import logger
@@ -0,0 +1,80 @@
1
+ import argparse
2
+ import shutil
3
+ import subprocess
4
+ import sys
5
+ import tempfile
6
+
7
+ from cave_cli.utils.display import step_done, step_start
8
+ from cave_cli.utils.logger import logger
9
+
10
+ PIPX_DOCS_URL = "https://pipx.pypa.io/stable/installation/"
11
+ CLI_REPO_URL = "https://github.com/MIT-CAVE/cave_cli.git"
12
+
13
+
14
+ def update(args: argparse.Namespace) -> None:
15
+ """
16
+ Usage:
17
+
18
+ - Updates the CAVE CLI via pipx.
19
+
20
+ Notes:
21
+
22
+ - Without ``--version``, installs the latest version from PyPI via
23
+ ``pipx install --force cave_cli``.
24
+ - With ``--version``, reinstalls via ``pipx install --force`` from the
25
+ specified git tag or branch.
26
+ - On Windows, the update runs in a new console window because Windows
27
+ locks running executables and cave.exe cannot replace itself.
28
+ """
29
+ pipx = shutil.which("pipx")
30
+ if not pipx:
31
+ logger.error(
32
+ "pipx not found. Please install pipx and reinstall cave_cli."
33
+ )
34
+ logger.error(f"See: {PIPX_DOCS_URL}")
35
+ sys.exit(1)
36
+
37
+ version = getattr(args, "version", None)
38
+ if version:
39
+ label = f"Reinstalling CAVE CLI ({version})"
40
+ spec = f"cave_cli @ git+{CLI_REPO_URL}@{version}"
41
+ else:
42
+ label = "Updating CAVE CLI"
43
+ spec = "cave_cli"
44
+
45
+ step_start(label)
46
+
47
+ if sys.platform == "win32":
48
+ # Windows locks running executables, so cave.exe cannot be replaced
49
+ # while this process is alive. Write a temp batch file and spawn a
50
+ # new console window that waits for this process to exit first.
51
+ # A batch file avoids quoting issues with paths containing spaces.
52
+ with tempfile.NamedTemporaryFile(
53
+ mode="w", suffix=".bat", delete=False
54
+ ) as f:
55
+ f.write("@echo off\r\n")
56
+ f.write("timeout /t 1 /nobreak >nul\r\n")
57
+ f.write(f'"{pipx}" install --force "{spec}"\r\n')
58
+ f.write('del "%~f0"\r\n')
59
+ bat_path = f.name
60
+ subprocess.Popen(
61
+ ["cmd", "/k", bat_path],
62
+ creationflags=subprocess.CREATE_NEW_CONSOLE,
63
+ )
64
+ step_done(label)
65
+ logger.success("CAVE CLI update started in a new window.")
66
+ return
67
+
68
+ result = subprocess.run(
69
+ [pipx, "install", "--force", spec],
70
+ stdout=subprocess.PIPE,
71
+ stderr=subprocess.PIPE,
72
+ text=True,
73
+ )
74
+ if result.returncode == 0:
75
+ step_done(label)
76
+ logger.success("CAVE CLI updated.")
77
+ else:
78
+ logger.error("Failed to update CAVE CLI.")
79
+ if result.stderr:
80
+ logger.error(result.stderr.strip())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cave_cli
3
- Version: 3.5.2
3
+ Version: 3.5.4
4
4
  Summary: CLI for creating and managing Docker-based CAVE web applications.
5
5
  Author-email: MIT-CAVE <cave-contact@mit.edu>
6
6
  License: Apache-2.0
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
 
10
10
  [project]
11
11
  name = "cave_cli"
12
- version = "3.5.2"
12
+ version = "3.5.4"
13
13
  description = "CLI for creating and managing Docker-based CAVE web applications."
14
14
  authors = [
15
15
  {name = "MIT-CAVE", email = "cave-contact@mit.edu"}
@@ -1,57 +0,0 @@
1
- import argparse
2
- import shutil
3
- import subprocess
4
- import sys
5
-
6
- from cave_cli.utils.display import step_done, step_start
7
- from cave_cli.utils.logger import logger
8
-
9
- PIPX_DOCS_URL = "https://pipx.pypa.io/stable/installation/"
10
-
11
-
12
- def update(args: argparse.Namespace) -> None:
13
- """
14
- Usage:
15
-
16
- - Updates the CAVE CLI via pipx.
17
-
18
- Notes:
19
-
20
- - Without ``--version``, runs ``pipx upgrade cave_cli``.
21
- - With ``--version``, reinstalls via ``pipx install --force`` from the
22
- specified git tag or branch.
23
- """
24
- pipx = shutil.which("pipx")
25
- if not pipx:
26
- logger.error(
27
- "pipx not found. Please install pipx and reinstall cave_cli."
28
- )
29
- logger.error(f"See: {PIPX_DOCS_URL}")
30
- sys.exit(1)
31
-
32
- version = getattr(args, "version", None)
33
- if version:
34
- spec = (
35
- f"cave_cli @ "
36
- f"git+https://github.com/MIT-CAVE/cave_cli.git@{version}"
37
- )
38
- cmd = [pipx, "install", "--force", spec]
39
- label = f"Reinstalling CAVE CLI ({version})"
40
- else:
41
- cmd = [pipx, "upgrade", "cave_cli"]
42
- label = "Updating CAVE CLI"
43
-
44
- step_start(label)
45
- result = subprocess.run(
46
- cmd,
47
- stdout=subprocess.PIPE,
48
- stderr=subprocess.PIPE,
49
- text=True,
50
- )
51
- if result.returncode == 0:
52
- step_done(label)
53
- logger.success("CAVE CLI updated.")
54
- else:
55
- logger.error("Failed to update CAVE CLI.")
56
- if result.stderr:
57
- logger.error(result.stderr.strip())
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