diff --git a/README.md b/README.md index d927af444..2001b43eb 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ curl -fsSL https://abdess.github.io/retrobios/i | sh -s -- --platform retroarch # Options in PowerShell: anything after | iex goes to iex, so the script runs as a block &([scriptblock]::Create((irm https://abdess.github.io/retrobios/i.ps1))) --check + +# With Python 3.8 or newer: the same installer as a package (or pipx run retrobios) +uvx retrobios ``` ![Recording of the one-line command in a terminal. The installer finds an ArkOS SD card with 6 games, plans 43 BIOS files (15.1 MB) for them, installs them and shows the summary.](docs_assets/demo/install.gif) diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index f7b8aa383..80c380910 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -39,7 +39,7 @@ from common import ( ) from nativemode import check_label import release_record -from siteguides import install_command +from siteguides import PACKAGE_COMMAND, install_command from validate_pr import LARGE_FILE_ISSUE_URL from largefiles import load_registered_paths import pr_checks @@ -633,6 +633,9 @@ def generate_readme(db: dict, platforms_dir: str, db_path: str = "database.json" "", "# Options in PowerShell: anything after | iex goes to iex, so the script runs as a block", install_command("powershell", "--check"), + "", + "# With Python 3.8 or newer: the same installer as a package (or pipx run retrobios)", + PACKAGE_COMMAND, "```", "", f"![{demo_description()}]({DEMO_GIF})", diff --git a/scripts/generate_site.py b/scripts/generate_site.py index 9cda2958f..dd023a06e 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -111,6 +111,7 @@ from siteguides import ( INSTALL_BASE, INSTALL_PS1, INSTALL_SH, + PACKAGE_COMMAND, TERMINALS, TRUST_ITEMS, detected_systems as _detected_systems, @@ -12013,6 +12014,13 @@ def generate_which_pack() -> str: *fence("powershell", install_command( "powershell", "--platform retroarch --dest E:\\retroarch\\cores\\system")), ]), + *markup.details("note", "Have Python? Run it as a package", [ + "The same installer, with Python 3.8 or newer:", + "", + *fence("sh", PACKAGE_COMMAND), + "", + "`pipx run retrobios` works too, or `pip install retrobios` and then `retrobios`.", + ]), *markup.details("note", "Copy the BIOS files from your old card", [ "Plug the old card in and add `--from` with its folder. The BIOS files " "found there are copied, and the rest downloaded. The old card is only read.", diff --git a/scripts/siteguides.py b/scripts/siteguides.py index a71a3edf7..12d449375 100644 --- a/scripts/siteguides.py +++ b/scripts/siteguides.py @@ -384,6 +384,8 @@ INSTALL_BASE: str = _LOADED["install_base"] # The bootstraps the site serves (sitebootstrap.py writes them). INSTALL_SH: str = f"{INSTALL_BASE}/{SH_NAME}" INSTALL_PS1: str = f"{INSTALL_BASE}/{PS1_NAME}" +# The same installer from PyPI (scripts/build_pypi.py builds the package). +PACKAGE_COMMAND = "uvx retrobios" DEVICE_GROUPS: dict[str, tuple[str, str]] = _LOADED["device_groups"] GROUP_ANCHORS: dict[str, str] = _LOADED["group_anchors"] ALSO_RUNS: dict[str, tuple[tuple[str, str, str, str, str], ...]] = _LOADED["also_runs"] diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index 6ca5886f1..a17356d6e 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -1566,7 +1566,7 @@ def _literals() -> str: VALUE = re.compile(r"^(?:\S*[\d/\\~<>{}=]\S*|--?[\w-]+\S*|\S*[A-Z]{2,}\S*|\.\.\.|" r"\S*\.\w{2,4}[,.:;)]?|[A-Z][a-z]+[A-Z]\S*|\(\S*)$") # A code span that is a command, a path or a shape, not a message. -NOT_A_MESSAGE = re.compile(r"^(?:\{|-|\.|/|~|<|\$|%|python|py |curl|irm|sh |pkg |sudo|ls |" +NOT_A_MESSAGE = re.compile(r"^(?:\{|-|\.|/|~|<|\$|%|python|py |curl|irm|uvx |pipx |pip |sh |pkg |sudo|ls |" r"xcode|winget|termux|install\.py|scripts/|generate_|&\()") diff --git a/wiki/installer.md b/wiki/installer.md index 894674a5d..97e8980a0 100644 --- a/wiki/installer.md +++ b/wiki/installer.md @@ -40,6 +40,15 @@ irm https://abdess.github.io/retrobios/i.ps1 | iex Always type the `https://`: without it the first request goes out in clear text, and anyone on the way could answer with another script. +With Python 3.8 or newer, the same installer is a package: + +```bash +uvx retrobios +``` + +`pipx run retrobios` works too, or `pip install retrobios` and then +`retrobios`. Options follow the command: `uvx retrobios --check`. + `i` and `i.ps1` are `install.sh` and `install.ps1` as of the commit the site was built from, set to download `install.py` from that same commit. The fingerprint they check and the installer they fetch never come from two