Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 2948c28

Browse files
committed
Template index url
(cherry picked from commit 898ef27)
1 parent 8a66e9b commit 2948c28

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

docs/source/conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ def get_controller_version():
6464
return asyncio.run(get_latest_compatible_controller_version(client_version=version))
6565

6666

67+
def get_index_url():
68+
name = os.getenv("SPHINX_MULTIVERSION_NAME")
69+
if name is None:
70+
return "https://pkg.jumpstarter.dev/simple"
71+
else:
72+
return "https://pkg.jumpstarter.dev/{}/simple".format(name)
73+
74+
6775
myst_heading_anchors = 3
6876
myst_enable_extensions = [
6977
"substitution",
@@ -72,6 +80,7 @@ def get_controller_version():
7280
"requires_python": ">=3.11",
7381
"version": "latest",
7482
"controller_version": get_controller_version(),
83+
"index_url": get_index_url(),
7584
}
7685

7786
doctest_test_doctest_blocks = ""

docs/source/getting-started/installation/packages.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@ tools you need to run an exporter or interact with your hardware as a client.
2020
Install the Python package using `pip` or a similar tool. You need Python
2121
{{requires_python}}:
2222

23-
```shell
24-
$ pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ jumpstarter-all
23+
```{code-block} shell
24+
:substitutions:
25+
$ pip3 install --extra-index-url {{index_url}} jumpstarter-all
2526
$ mkdir -p "${HOME}/.config/jumpstarter/"
2627
$ sudo mkdir /etc/jumpstarter
2728
```
2829

2930
The command above installs packages globally. For library usage, we recommend
3031
installing in a virtual environment instead:
3132

32-
```shell
33+
```{code-block} shell
34+
:substitutions:
3335
$ python3 -m venv ~/.venv/jumpstarter
3436
$ source ~/.venv/jumpstarter/bin/activate
35-
$ pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ jumpstarter-all
37+
$ pip3 install --extra-index-url {{index_url}} jumpstarter-all
3638
```
3739

3840
Additional package indexes are available, this is a complete list of our indexes:

packages/jumpstarter-cli-admin/jumpstarter_cli_admin/controller.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import aiohttp
2-
import click
32
import semver
43
from jumpstarter_cli_common.version import get_client_version
54
from packaging.version import Version
@@ -23,13 +22,13 @@ async def get_latest_compatible_controller_version(
2322
) as resp:
2423
resp = await resp.json()
2524
except Exception as e:
26-
raise click.ClickException(f"Failed to fetch controller versions: {e}") from e
25+
raise RuntimeError(f"Failed to fetch controller versions: {e}") from e
2726

2827
compatible = set()
2928
fallback = set()
3029

3130
if not isinstance(resp, dict) or "tags" not in resp or not isinstance(resp["tags"], list):
32-
raise click.ClickException("Unexpected response fetching controller version")
31+
raise RuntimeError("Unexpected response fetching controller version")
3332

3433
for tag in resp["tags"]:
3534
if not isinstance(tag, dict) or "name" not in tag:

0 commit comments

Comments
 (0)