envxx 0.1.0__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.
envxx/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """EnvXX - portable multi-runtime manager."""
2
+
3
+ __version__ = "0.1.0"
envxx/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ import sys
2
+
3
+ from envxx.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ sys.exit(main())
envxx/_click.py ADDED
@@ -0,0 +1,21 @@
1
+ """Click exception types, wherever Typer gets them from.
2
+
3
+ Newer Typer releases vendor Click as ``typer._click``; older ones depend on
4
+ the real ``click`` package. The type raised must be the one Typer raises, so
5
+ prefer the vendored copy when present.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import typer
11
+
12
+ ClickExit = typer.Exit
13
+
14
+ try: # Typer >= 0.16
15
+ from typer._click.core import UsageError as ClickUsageError
16
+ from typer._click.exceptions import NoArgsIsHelpError as ClickNoArgsIsHelp
17
+ except ImportError: # pragma: no cover - older Typer with real click
18
+ from click.core import UsageError as ClickUsageError # type: ignore
19
+ from click.exceptions import NoArgsIsHelpError as ClickNoArgsIsHelp # type: ignore
20
+
21
+ __all__ = ["ClickExit", "ClickNoArgsIsHelp", "ClickUsageError"]
envxx/archive.py ADDED
@@ -0,0 +1,144 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import shutil
5
+ import stat
6
+ import tarfile
7
+ import zipfile
8
+ from pathlib import Path
9
+
10
+ from .errors import ArchiveError
11
+
12
+ _CHUNK = 1024 * 1024
13
+
14
+
15
+ def _fs(path: Path) -> str:
16
+ """Filesystem path string; Windows long paths need the \\\\?\\ prefix.
17
+
18
+ Node's npm tree nests deep enough to exceed MAX_PATH, so every write path
19
+ goes through this helper.
20
+ """
21
+ text = str(path)
22
+ if os.name != "nt":
23
+ return text
24
+ if text.startswith("\\\\?\\"):
25
+ return text
26
+ if text.startswith("\\\\"):
27
+ return "\\\\?\\UNC\\" + text[2:]
28
+ return "\\\\?\\" + text
29
+
30
+
31
+ def _safe_target(dest: Path, member_name: str) -> Path:
32
+ """Resolve an archive member against dest, rejecting escapes."""
33
+ normalized = member_name.replace("\\", "/")
34
+ if normalized.startswith("/") or (len(normalized) > 1 and normalized[1] == ":"):
35
+ raise ArchiveError(f"absolute path in archive: {member_name}")
36
+
37
+ root = os.path.normpath(str(dest))
38
+ target = os.path.normpath(os.path.join(root, normalized))
39
+ if target != root and not target.startswith(root + os.sep):
40
+ raise ArchiveError(f"path escapes destination: {member_name}")
41
+ return Path(target)
42
+
43
+
44
+ def _strip_top(name: str) -> str:
45
+ parts = [p for p in name.replace("\\", "/").split("/") if p not in ("", ".")]
46
+ if len(parts) <= 1:
47
+ return ""
48
+ return "/".join(parts[1:])
49
+
50
+
51
+ def _extract_tar(archive: Path, dest: Path, strip_top: bool) -> None:
52
+ with tarfile.open(archive, "r:*") as tar:
53
+ for member in tar.getmembers():
54
+ name = _strip_top(member.name) if strip_top else member.name
55
+ if not name:
56
+ continue
57
+ target = _safe_target(dest, name)
58
+
59
+ if member.issym() or member.islnk():
60
+ link_target_raw = member.linkname
61
+ if os.path.isabs(link_target_raw):
62
+ raise ArchiveError(f"absolute symlink in archive: {member.name}")
63
+ if member.issym():
64
+ _safe_target(dest, str((Path(name).parent / link_target_raw)))
65
+ os.makedirs(_fs(target.parent), exist_ok=True)
66
+ if os.path.lexists(_fs(target)):
67
+ os.unlink(_fs(target))
68
+ os.symlink(link_target_raw, _fs(target))
69
+ else:
70
+ source = _safe_target(dest, link_target_raw)
71
+ if not os.path.exists(_fs(source)):
72
+ raise ArchiveError(f"hard link target missing: {member.name}")
73
+ os.makedirs(_fs(target.parent), exist_ok=True)
74
+ if os.path.lexists(_fs(target)):
75
+ os.unlink(_fs(target))
76
+ os.link(_fs(source), _fs(target))
77
+ continue
78
+
79
+ if member.isdir():
80
+ os.makedirs(_fs(target), exist_ok=True)
81
+ continue
82
+
83
+ if not member.isfile():
84
+ continue
85
+
86
+ os.makedirs(_fs(target.parent), exist_ok=True)
87
+ source = tar.extractfile(member)
88
+ if source is None:
89
+ continue
90
+ with source, open(_fs(target), "wb") as out:
91
+ shutil.copyfileobj(source, out, _CHUNK)
92
+
93
+ mode = member.mode
94
+ if mode and os.name != "nt":
95
+ os.chmod(_fs(target), mode & 0o777 or 0o644)
96
+
97
+
98
+ def _extract_zip(archive: Path, dest: Path, strip_top: bool) -> None:
99
+ with zipfile.ZipFile(archive) as zf:
100
+ for info in zf.infolist():
101
+ name = _strip_top(info.filename) if strip_top else info.filename
102
+ if not name:
103
+ continue
104
+ target = _safe_target(dest, name)
105
+ if info.is_dir():
106
+ os.makedirs(_fs(target), exist_ok=True)
107
+ continue
108
+ os.makedirs(_fs(target.parent), exist_ok=True)
109
+ with zf.open(info) as source, open(_fs(target), "wb") as out:
110
+ shutil.copyfileobj(source, out, _CHUNK)
111
+
112
+ # zipfile does not preserve unix mode; recover it from external_attr
113
+ unix_mode = (info.external_attr >> 16) & 0xFFFF
114
+ if os.name != "nt":
115
+ if unix_mode and stat.S_ISREG(unix_mode):
116
+ os.chmod(_fs(target), unix_mode & 0o777)
117
+ else:
118
+ os.chmod(_fs(target), 0o755 if unix_mode & 0o111 else 0o644)
119
+
120
+
121
+ def extract(archive: Path, dest: Path, strip_top: bool = True) -> None:
122
+ os.makedirs(_fs(dest), exist_ok=True)
123
+ name = archive.name.lower()
124
+ # a .vsix is a zip container, which is how VSCode extensions ship
125
+ if name.endswith((".zip", ".vsix")):
126
+ _extract_zip(archive, dest, strip_top)
127
+ elif name.endswith((".tar.gz", ".tgz")):
128
+ _extract_tar(archive, dest, strip_top)
129
+ else:
130
+ raise ArchiveError(f"unsupported archive format: {archive.name}")
131
+
132
+
133
+ def copy_single(src: Path, dest: Path, name: str | None = None) -> Path:
134
+ """Install a single-file artifact (e.g. a standalone .exe) into dest.
135
+
136
+ Release asset names carry the version ('CC-Switch-v4.0.31-Linux-x86_64.AppImage')
137
+ while the entrypoint is version independent, so callers may rename.
138
+ """
139
+ os.makedirs(_fs(dest), exist_ok=True)
140
+ target = dest / (name or src.name)
141
+ shutil.copy2(src, _fs(target))
142
+ if os.name != "nt":
143
+ os.chmod(_fs(target), os.stat(_fs(target)).st_mode | 0o111)
144
+ return target
envxx/cli.py ADDED
@@ -0,0 +1,429 @@
1
+ from __future__ import annotations
2
+
3
+ import errno
4
+ import os
5
+ import re
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ import typer
10
+ from rich.console import Console
11
+ from rich.table import Table
12
+
13
+ from ._click import ClickExit, ClickNoArgsIsHelp, ClickUsageError
14
+
15
+ from . import install as installer
16
+ from . import run as runner
17
+ from . import store
18
+ from .errors import EnvxxError, UsageError
19
+ from .platforms import detect_platform
20
+ from .providers import Provider, provider_types, tool_specs
21
+ from .providers.spec import ToolSpec
22
+ from .versions import best_match, version_key
23
+
24
+ out = Console()
25
+ err = Console(stderr=True)
26
+
27
+ CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]}
28
+
29
+ app = typer.Typer(
30
+ add_completion=False,
31
+ no_args_is_help=True,
32
+ context_settings=CONTEXT_SETTINGS,
33
+ help=(
34
+ "Portable copies of python, node, claude and friends. "
35
+ "Everything lives in ~/.envxx; delete the folder to uninstall."
36
+ ),
37
+ epilog=(
38
+ "Examples:\n"
39
+ "envxx python3.11 -m pip install requests\n"
40
+ "envxx node22 -v\n"
41
+ "envxx claude\n"
42
+ "envxx node search"
43
+ ),
44
+ )
45
+
46
+ # tool catalogues such as claude's run to hundreds of entries
47
+ SEARCH_LIMIT = 10
48
+
49
+
50
+ # ---------------------------------------------------------------------------
51
+ # registry-driven parsing
52
+ # ---------------------------------------------------------------------------
53
+ def _selector_table() -> list[tuple[re.Pattern[str], ToolSpec]]:
54
+ table = []
55
+ for spec in tool_specs():
56
+ if not spec.versioned:
57
+ continue
58
+ for prefix in sorted(spec.selector_prefixes, key=len, reverse=True):
59
+ pattern = re.compile(rf"^{re.escape(prefix)}(\d+(?:\.\d+){{0,2}})$")
60
+ table.append((pattern, spec))
61
+ return table
62
+
63
+
64
+ def _match_selector(token: str) -> tuple[ToolSpec, str] | None:
65
+ for pattern, spec in _selector_table():
66
+ match = pattern.match(token)
67
+ if match:
68
+ return spec, match.group(1)
69
+ return None
70
+
71
+
72
+ def _find_spec(name: str) -> ToolSpec | None:
73
+ for spec in tool_specs():
74
+ if spec.name == name or name in spec.aliases:
75
+ return spec
76
+ return None
77
+
78
+
79
+ def _provider(spec: ToolSpec) -> Provider:
80
+ return provider_types()[spec.name](detect_platform())
81
+
82
+
83
+ # ---------------------------------------------------------------------------
84
+ # version resolution
85
+ # ---------------------------------------------------------------------------
86
+ def _ensure_installed(provider: Provider, query: str | None) -> str:
87
+ """An installed match wins; otherwise resolve remotely and install it."""
88
+ installed = store.installed_versions(provider.spec.name)
89
+ if query is None:
90
+ if installed:
91
+ return max(installed, key=version_key)
92
+ else:
93
+ match = best_match(installed, query)
94
+ if match:
95
+ return match
96
+
97
+ version = provider.resolve(query)
98
+ if not store.is_installed(provider.spec.name, version):
99
+ installer.install(provider, version)
100
+ return version
101
+
102
+
103
+ def _split_entrypoint(
104
+ provider: Provider, version: str, args: list[str]
105
+ ) -> tuple[str | None, list[str]]:
106
+ """'envxx node22 npm run dev' -> ('npm', ['run', 'dev']).
107
+
108
+ Without this, 'npm' looks like an argument to node and node tries to load
109
+ a module by that name. Only the non-default entrypoints count, so
110
+ 'envxx node22 script.js' still passes the file to node untouched.
111
+
112
+ A console script that pip installed into the runtime counts too, which is
113
+ what makes 'envxx python3.11 envxx' work after 'pip install -e .'.
114
+ """
115
+ spec = provider.spec
116
+ if not args:
117
+ return None, args
118
+
119
+ head = args[0]
120
+ declared = {entry.name for entry in spec.entrypoints} - {spec.default_entrypoint}
121
+ if head in declared:
122
+ return head, args[1:]
123
+ if spec.script_dirs and provider.script_path(version, head) is not None:
124
+ return head, args[1:]
125
+ return None, args
126
+
127
+
128
+ def _split_target(target: str) -> tuple[str, str | None, str | None]:
129
+ """'node@22:npm' -> ('node', '22', 'npm')."""
130
+ name, _, rest = target.partition("@")
131
+ if not rest:
132
+ name, _, rest = target.partition(":")
133
+ return name, None, rest or None
134
+ query, sep, entry = rest.partition(":")
135
+ return name, query or None, (entry or None) if sep else None
136
+
137
+
138
+ def _dispatch_run(token: str, rest: list[str]) -> int:
139
+ """Handle 'python3.11 ...', 'node22 ...', bare app names and 'envxx run'."""
140
+ if token == "run":
141
+ if not rest:
142
+ raise UsageError("usage: envxx run <tool>[@version][:entrypoint] -- <args>")
143
+ target, *args = rest
144
+ if args and args[0] == "--":
145
+ args = args[1:]
146
+ name, query, entry = _split_target(target)
147
+ spec = _find_spec(name)
148
+ if spec is None:
149
+ raise UsageError(f"unknown tool: {name}")
150
+ provider = _provider(spec)
151
+ version = _ensure_installed(provider, query)
152
+ return runner.run(provider, version, args, entrypoint=entry)
153
+
154
+ matched = _match_selector(token)
155
+ if matched:
156
+ spec, query = matched
157
+ provider = _provider(spec)
158
+ version = _ensure_installed(provider, query)
159
+ entry, args = _split_entrypoint(provider, version, rest)
160
+ return runner.run(provider, version, args, entrypoint=entry)
161
+
162
+ spec = _find_spec(token)
163
+ if spec is not None:
164
+ provider = _provider(spec)
165
+ version = _ensure_installed(provider, None)
166
+ entry, args = _split_entrypoint(provider, version, rest)
167
+ return runner.run(provider, version, args, entrypoint=entry)
168
+
169
+ raise UsageError(f"unknown command: {token}")
170
+
171
+
172
+ # ---------------------------------------------------------------------------
173
+ # helpers
174
+ # ---------------------------------------------------------------------------
175
+ def _fmt_size(size: int | None) -> str:
176
+ if not size:
177
+ return ""
178
+ value = float(size)
179
+ for unit in ("B", "KB", "MB", "GB"):
180
+ if value < 1024 or unit == "GB":
181
+ return f"{value:.0f}{unit}" if unit == "B" else f"{value:.1f}{unit}"
182
+ value /= 1024
183
+ return ""
184
+
185
+
186
+ def _display_path(path: Path) -> str:
187
+ """Show paths inside the store relative to it, so tables stay readable."""
188
+ try:
189
+ return "~/.envxx/" + path.relative_to(store.home()).as_posix()
190
+ except ValueError:
191
+ return str(path)
192
+
193
+
194
+ def _dir_size(path: Path) -> int:
195
+ total = 0
196
+ for entry in path.rglob("*"):
197
+ try:
198
+ if entry.is_file() and not entry.is_symlink():
199
+ total += entry.stat().st_size
200
+ except OSError:
201
+ pass
202
+ return total
203
+
204
+
205
+ # ---------------------------------------------------------------------------
206
+ # per-tool subcommands
207
+ # ---------------------------------------------------------------------------
208
+ def _add_tool_commands(group: typer.Typer, spec: ToolSpec) -> None:
209
+ @group.command("search")
210
+ def search(all_versions: bool = typer.Option(False, "--all", help="show every version")) -> None:
211
+ """Remote versions available for this platform."""
212
+ provider = _provider(spec)
213
+ # providers with huge catalogues serve a short recent list by default
214
+ # and only walk the whole thing when --all is explicit
215
+ if all_versions:
216
+ infos = provider.search_all()
217
+ else:
218
+ infos = provider.display_versions()
219
+ # every catalogue is newest first, so an app list only needs trimming
220
+ installed = set(store.installed_versions(spec.name))
221
+ hidden = 0
222
+ if spec.kind == "app" and not all_versions and len(infos) > SEARCH_LIMIT:
223
+ hidden = len(infos) - SEARCH_LIMIT
224
+ infos = infos[:SEARCH_LIMIT]
225
+
226
+ table = Table(title=f"{spec.name} available", header_style="bold")
227
+ table.add_column("version")
228
+ table.add_column("channel")
229
+ # catalogues that carry no publication dates (claude, cc-switch) would
230
+ # only get an empty column, so show it when at least one row has one
231
+ show_released = any(info.released for info in infos)
232
+ if show_released:
233
+ table.add_column("released")
234
+ table.add_column("installed")
235
+ for info in infos:
236
+ status = "[green]yes[/green]" if info.version in installed else "[dim]-[/dim]"
237
+ cells = [info.version, info.notes or info.channel]
238
+ if show_released:
239
+ cells.append(info.released or "")
240
+ cells.append(status)
241
+ table.add_row(*cells)
242
+ out.print(table)
243
+ if hidden:
244
+ err.print(f"[dim]{hidden} more, use --all to list them[/dim]")
245
+ if not infos:
246
+ err.print(f"[yellow]no {spec.name} versions for this platform[/yellow]")
247
+
248
+ @group.command("list")
249
+ def list_cmd() -> None:
250
+ """Versions already downloaded."""
251
+ versions = store.installed_versions(spec.name)
252
+ if not versions:
253
+ err.print(f"[dim]no {spec.name} versions installed[/dim]")
254
+ return
255
+ table = Table(title=f"{spec.name} installed", header_style="bold")
256
+ table.add_column("version")
257
+ table.add_column("path")
258
+ table.add_column("size", justify="right")
259
+ for version in sorted(versions, key=version_key, reverse=True):
260
+ path = store.version_dir(spec.name, version)
261
+ table.add_row(version, _display_path(path), _fmt_size(_dir_size(path)))
262
+ out.print(table)
263
+
264
+ @group.command("install")
265
+ def install_cmd(
266
+ version: str | None = typer.Argument(
267
+ None if spec.kind == "app" else ...,
268
+ help="e.g. 3.11, 3.11.9, 22" + (", defaults to latest" if spec.kind == "app" else ""),
269
+ ),
270
+ force: bool = typer.Option(False, "--force", help="reinstall if present"),
271
+ ) -> None:
272
+ """Download and install a version."""
273
+ provider = _provider(spec)
274
+ resolved = provider.resolve(version)
275
+ if force and store.is_installed(spec.name, resolved):
276
+ store.remove_version(spec.name, resolved)
277
+ installer.install(provider, resolved)
278
+
279
+ # apps get an 'rm' shorthand below; listing both with the same description
280
+ # is just noise, so keep 'uninstall' working but out of the help
281
+ @group.command("uninstall", hidden=spec.kind == "app")
282
+ def uninstall_cmd(
283
+ version: str | None = typer.Argument(None, help="version to remove"),
284
+ yes: bool = typer.Option(False, "--yes", "-y", help="skip confirmation"),
285
+ ) -> None:
286
+ """Remove an installed version."""
287
+ versions = store.installed_versions(spec.name)
288
+ if not versions:
289
+ raise UsageError(f"no {spec.name} versions installed")
290
+ target = best_match(versions, version) if version else max(versions, key=version_key)
291
+ if not target:
292
+ raise UsageError(f"{spec.name} {version} is not installed")
293
+ if not yes and not typer.confirm(f"remove {spec.name} {target}?", default=False):
294
+ raise typer.Abort()
295
+ store.remove_version(spec.name, target)
296
+ out.print(f"removed {spec.name} {target}")
297
+
298
+ if spec.kind == "app":
299
+ # 'rm' is the usual shorthand for an app-style tool
300
+ group.command("rm", help="Remove an installed version.")(uninstall_cmd)
301
+
302
+ @group.command("update")
303
+ def update_cmd() -> None:
304
+ """Install the newest version and point the default at it."""
305
+ provider = _provider(spec)
306
+ latest = provider.default_version()
307
+ installed = store.installed_versions(spec.name)
308
+ if latest in installed:
309
+ out.print(f"{spec.name} {latest} is already the latest")
310
+ else:
311
+ installer.install(provider, latest)
312
+ older = sorted(
313
+ (v for v in installed if v != latest), key=version_key, reverse=True
314
+ )
315
+ if older:
316
+ joined = ", ".join(older)
317
+ err.print(
318
+ f"[dim]older versions still on disk: {joined}"
319
+ f" (envxx {spec.name} rm {older[0]} to remove)[/dim]"
320
+ )
321
+
322
+ @group.command("where")
323
+ def where_cmd(version: str | None = typer.Argument(None)) -> None:
324
+ """Print the absolute path of an installed launcher."""
325
+ provider = _provider(spec)
326
+ installed = store.installed_versions(spec.name)
327
+ resolved = best_match(installed, version) if version else (
328
+ max(installed, key=version_key) if installed else None
329
+ )
330
+ if not resolved:
331
+ raise UsageError(f"{spec.name} {version or ''} is not installed".strip())
332
+ out.print(runner.which(provider, resolved))
333
+
334
+
335
+ for _spec in tool_specs():
336
+ _group = typer.Typer(
337
+ add_completion=False,
338
+ no_args_is_help=True,
339
+ context_settings=CONTEXT_SETTINGS,
340
+ help=_spec.summary,
341
+ )
342
+ _add_tool_commands(_group, _spec)
343
+ app.add_typer(_group, name=_spec.name)
344
+
345
+
346
+ # ---------------------------------------------------------------------------
347
+ # entry point
348
+ # ---------------------------------------------------------------------------
349
+ def _pipe_is_gone(exc: OSError) -> bool:
350
+ """True when the error means the reader went away mid-write.
351
+
352
+ A downstream reader that exits early ('envxx --help | head') closes the
353
+ pipe; writing there raises EPIPE on Unix but EINVAL on Windows, and rich
354
+ only recognises BrokenPipeError.
355
+ """
356
+ if exc.errno == errno.EPIPE:
357
+ return True
358
+ return os.name == "nt" and exc.errno == errno.EINVAL
359
+
360
+
361
+ def _silence_streams() -> None:
362
+ """Point stdout/stderr at devnull so the interpreter's exit flush is quiet.
363
+
364
+ Without this the final flush of the already-broken stream prints a second
365
+ 'Exception ignored in ... OSError' block after we have recovered.
366
+ """
367
+ devnull = os.open(os.devnull, os.O_WRONLY)
368
+ for stream in (sys.stdout, sys.stderr):
369
+ try:
370
+ os.dup2(devnull, stream.fileno())
371
+ except (OSError, ValueError):
372
+ pass
373
+
374
+
375
+ def main(argv: list[str] | None = None) -> int:
376
+ argv = list(sys.argv[1:] if argv is None else argv)
377
+
378
+ try:
379
+ if argv:
380
+ token, rest = argv[0], argv[1:]
381
+ spec = _find_spec(token)
382
+ # 'node -v' passes a flag, so it means "execute", not "manage";
383
+ # bare 'node', 'node list' and 'node --help' belong to envxx.
384
+ flag_run = (
385
+ spec is not None
386
+ and bool(rest)
387
+ and rest[0].startswith("-")
388
+ and rest[0] not in ("-h", "--help")
389
+ )
390
+ bare_app_run = spec is not None and spec.kind == "app" and not rest
391
+ should_run = (
392
+ token == "run"
393
+ or _match_selector(token) is not None
394
+ or flag_run
395
+ or bare_app_run
396
+ )
397
+ if should_run:
398
+ return _dispatch_run(token, rest)
399
+ app(args=argv, standalone_mode=False)
400
+ return 0
401
+ except EnvxxError as exc:
402
+ err.print(f"[red]error:[/red] {exc}")
403
+ return 1
404
+ except ClickNoArgsIsHelp:
405
+ # click raises this with 'ctx.get_help()' as the message, but Typer's
406
+ # rich help writes straight to stdout, so the message is empty and
407
+ # only a bare 'error:' would be left over. The help is already on
408
+ # screen; just report the usage status code.
409
+ return 2
410
+ except ClickUsageError as exc:
411
+ err.print(f"[red]error:[/red] {exc.format_message()}")
412
+ return 2
413
+ except ClickExit as exc:
414
+ return exc.exit_code
415
+ except typer.Abort:
416
+ return 130
417
+ except KeyboardInterrupt:
418
+ return 130
419
+ except OSError as exc:
420
+ if not _pipe_is_gone(exc):
421
+ raise
422
+ # The reader stopped listening ('envxx --help | head'). The command
423
+ # itself did its job, so report success and leave it at that.
424
+ _silence_streams()
425
+ return 0
426
+
427
+
428
+ if __name__ == "__main__":
429
+ sys.exit(main())
envxx/errors.py ADDED
@@ -0,0 +1,34 @@
1
+ class EnvxxError(Exception):
2
+ """Base class for all user-facing errors."""
3
+
4
+
5
+ class UsageError(EnvxxError):
6
+ pass
7
+
8
+
9
+ class NetworkError(EnvxxError):
10
+ pass
11
+
12
+
13
+ class VersionNotFound(EnvxxError):
14
+ pass
15
+
16
+
17
+ class UnsupportedPlatform(EnvxxError):
18
+ pass
19
+
20
+
21
+ class ChecksumError(EnvxxError):
22
+ pass
23
+
24
+
25
+ class ArchiveError(EnvxxError):
26
+ pass
27
+
28
+
29
+ class InstallError(EnvxxError):
30
+ pass
31
+
32
+
33
+ class LockTimeout(EnvxxError):
34
+ pass