add command to show version and corresponding release tags as pairs which can be used for the get command, related to #10

This commit is contained in:
Florian Förster 2025-07-04 13:01:11 +02:00
parent 54bd6026c9
commit 6061294b28
3 changed files with 23 additions and 1 deletions

View File

@ -1,5 +1,5 @@
from pathlib import Path
from typing import Final
from typing import Final, TypeAlias
LIB_ROOT_FOLDER: Final[Path] = Path(__file__).parent
if not LIB_ROOT_FOLDER.exists():
@ -8,3 +8,9 @@ if not LIB_ROOT_FOLDER.exists():
MSVC_FOLDER: Final[Path] = LIB_ROOT_FOLDER / "_files/msvc-redist"
if not MSVC_FOLDER.exists():
raise FileNotFoundError(f"Folder for MSVC Redist files not found under: >{MSVC_FOLDER}<")
PyVersionToReleaseTag: TypeAlias = tuple[str, str]
PY_VERSION_TO_RELEASE_TAG_PAIRS: Final[tuple[PyVersionToReleaseTag, ...]] = (
("3.11.12", "20250409"),
("3.11.13", "20250702"),
)

View File

@ -11,6 +11,7 @@ from dopt_basics.io import combine_route
from requests.exceptions import HTTPError
from pycage import config
from pycage.constants import PY_VERSION_TO_RELEASE_TAG_PAIRS
from pycage.helpers import (
delete_files,
delete_folder_recursively,
@ -237,3 +238,17 @@ def get(
"The archive file could not be deleted because of following exception..."
)
print_error(err)
@click.command(
help=(
"show supported Python version and corresponding release tags from the"
"standalone repository to have a quick lookup which version can be downloaded "
"with which release tag, information can be used with the 'get' command"
)
)
def show_version_release_tag() -> None:
click.echo("Known version and release tag pairs are...")
click.echo("Python Version --> Release Tag")
for pair in PY_VERSION_TO_RELEASE_TAG_PAIRS:
click.echo(f"{pair[0]:<8} --> {pair[1]:>9}")

View File

@ -15,6 +15,7 @@ def cli():
cli.add_command(pycage.get.get)
cli.add_command(pycage.get.show_version_release_tag)
cli.add_command(pycage.venv.venv)
cli.add_command(pycage.files.copy)
cli.add_command(pycage.compile.compile)