Support R full version provided by user

i.e. MAJOR.MINOR.PATCH.
pull/1456/head
Raniere Gaia Costa da Silva 2025-08-28 10:23:31 +02:00
rodzic 88d489de52
commit 3079a04fb8
1 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -101,13 +101,18 @@ class RBuildPack(PythonBuildPack):
if r_version in version_map:
r_version = version_map[r_version]
else:
# Instead of appending ".0" to future R versions,
# repo2docker fails earlier with a meaningful message to the user.
# If repo2docker doesn't fail here, repo2docker might fail later
# without a meaningul message to the user.
raise RuntimeError(
f"R version {r_version} is not supported. Please open an issue using https://github.com/jupyterhub/repo2docker/issues/new?template=BLANK_ISSUE.",
)
r_version_parts = r_version.split(".")
if len(r_version_parts) == 3:
warnings.warn(
f"Using R full version, {r_version}, provided by user."
)
else:
# repo2docker fails earlier with a meaningful message to the user.
# If repo2docker doesn't fail here, repo2docker might fail later
# without a meaningul message to the user.
raise RuntimeError(
f"R version {r_version} is not supported. Please open an issue using https://github.com/jupyterhub/repo2docker/issues/new?template=BLANK_ISSUE.",
)
else:
warnings.warn(
f"Using R version {r_version} instead of full version, i.e. MAJOR.MINOR.PATCH."