Skip to content

Commit 18e76f9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 49bdc6c commit 18e76f9

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

repo2docker/buildpacks/r.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# that seems to have a working IRKernel.
1414
RSPM_CUTOFF_DATE = datetime.date(2018, 12, 7)
1515

16+
1617
class RBuildPack(PythonBuildPack):
1718
"""
1819
Setup R for use with a repository
@@ -270,9 +271,9 @@ def get_build_scripts(self):
270271
"""
271272
if self.checkpoint_date < RSPM_CUTOFF_DATE:
272273
raise RuntimeError(
273-
f'Microsoft killed MRAN, the source of R package snapshots before {RSPM_CUTOFF_DATE.strftime("%Y-%m-%d")}. '\
274-
f'This repo has a snapshot date of {self.checkpoint_date.strftime("%Y-%m-%d")} specified in runtime.txt. '\
275-
'Please use a newer snapshot date'
274+
f'Microsoft killed MRAN, the source of R package snapshots before {RSPM_CUTOFF_DATE.strftime("%Y-%m-%d")}. '
275+
f'This repo has a snapshot date of {self.checkpoint_date.strftime("%Y-%m-%d")} specified in runtime.txt. '
276+
"Please use a newer snapshot date"
276277
)
277278

278279
cran_mirror_url = self.get_rspm_snapshot_url(self.checkpoint_date)

tests/unit/test_r.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ def test_mran_dead(tmpdir, base_image):
7878
tmpdir.chdir()
7979

8080
with open("runtime.txt", "w") as f:
81-
f.write('r-3.6-2017-06-04')
81+
f.write("r-3.6-2017-06-04")
8282

8383
r = buildpacks.RBuildPack(base_image)
84-
with pytest.raises(RuntimeError, match=r'^Microsoft killed MRAN, the source of R package snapshots before 2018-12-07.*'):
85-
r.get_build_scripts()
84+
with pytest.raises(
85+
RuntimeError,
86+
match=r"^Microsoft killed MRAN, the source of R package snapshots before 2018-12-07.*",
87+
):
88+
r.get_build_scripts()

0 commit comments

Comments
 (0)