Skip to content

Commit

Permalink
s/bionic/focal/ and hope
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Jun 3, 2022
1 parent 3c6e500 commit ad0f712
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
36 changes: 16 additions & 20 deletions repo2docker/buildpacks/r.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ def r_version(self):
"""
version_map = {
"3.4": "3.4",
"3.5": "3.5.3-1bionic",
"3.5.0": "3.5.0-1bionic",
"3.5.1": "3.5.1-2bionic",
"3.5.2": "3.5.2-1bionic",
"3.5.3": "3.5.3-1bionic",
"3.6": "3.6.3-1bionic",
"3.6.0": "3.6.0-2bionic",
"3.6.1": "3.6.1-3bionic",
"4.0": "4.0.5-1.1804.0",
"4.0.2": "4.0.2-1.1804.0",
"4.1": "4.1.2-1.1804.0",
"3.5": "3.5.3-1focal",
"3.5.0": "3.5.0-1focal",
"3.5.1": "3.5.1-2focal",
"3.5.2": "3.5.2-1focal",
"3.5.3": "3.5.3-1focal",
"3.6": "3.6.1-3focal",
"3.6.0": "3.6.0-2focal",
"3.6.1": "3.6.1-3focal",
"4.0": "4.0.5-1.2004.0",
"4.0.2": "4.0.2-1.2004.0",
"4.1": "4.1.2-1.2004.0",
}
# the default if nothing is specified
r_version = "4.1"
Expand Down Expand Up @@ -274,12 +274,11 @@ def get_build_scripts(self):
vs = "40"
else:
vs = "35"

scripts = [
(
"root",
rf"""
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran{vs}/" > /etc/apt/sources.list.d/r-ubuntu.list
echo "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran{vs}/" > /etc/apt/sources.list.d/r-ubuntu.list
""",
),
# Dont use apt-key directly, as gpg does not always respect *_proxy vars. This increase the chances
Expand All @@ -292,16 +291,13 @@ def get_build_scripts(self):
),
(
"root",
# we should have --no-install-recommends on all our apt-get install commands,
# but here it's important because it will pull in CRAN packages
# via r-recommends, which is only guaranteed to be compatible with the latest r-base-core
r"""
apt-get update > /dev/null && \
apt-get install --yes --no-install-recommends \
r-base-core={R_version} \
apt-get update && \
apt-get install --yes r-base={R_version} \
r-base-dev={R_version} \
r-recommended={R_version} \
libclang-dev \
libzmq3-dev > /dev/null && \
libzmq3-dev && \
apt-get -qq purge && \
apt-get -qq clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_r.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_version_completion(tmpdir):
f.write(f"r-3.6-2019-01-01")

r = buildpacks.RBuildPack()
assert r.r_version == "3.6.3-1bionic"
assert r.r_version == "3.6.3-3focal"


@pytest.mark.parametrize(
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_custom_cran_apt_repo(tmpdir):

# check that at least one of the build scripts adds this new apt repository
for user, script in scripts:
if "https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" in script:
if "https://cloud.r-project.org/bin/linux/ubuntu focal-cran35/" in script:
break
else:
assert False, "Should have added a new apt repository"
Expand Down

0 comments on commit ad0f712

Please sign in to comment.