diff --git a/repo2docker/buildpacks/r.py b/repo2docker/buildpacks/r.py index 8f92e0f01..7dd724e04 100644 --- a/repo2docker/buildpacks/r.py +++ b/repo2docker/buildpacks/r.py @@ -13,6 +13,7 @@ # that seems to have a working IRKernel. RSPM_CUTOFF_DATE = datetime.date(2018, 12, 7) + class RBuildPack(PythonBuildPack): """ Setup R for use with a repository @@ -270,9 +271,9 @@ def get_build_scripts(self): """ if self.checkpoint_date < RSPM_CUTOFF_DATE: raise RuntimeError( - f'Microsoft killed MRAN, the source of R package snapshots before {RSPM_CUTOFF_DATE.strftime("%Y-%m-%d")}. '\ - f'This repo has a snapshot date of {self.checkpoint_date.strftime("%Y-%m-%d")} specified in runtime.txt. '\ - 'Please use a newer snapshot date' + f'Microsoft killed MRAN, the source of R package snapshots before {RSPM_CUTOFF_DATE.strftime("%Y-%m-%d")}. ' + f'This repo has a snapshot date of {self.checkpoint_date.strftime("%Y-%m-%d")} specified in runtime.txt. ' + "Please use a newer snapshot date" ) cran_mirror_url = self.get_rspm_snapshot_url(self.checkpoint_date) diff --git a/tests/unit/test_r.py b/tests/unit/test_r.py index d50295951..a7028d829 100644 --- a/tests/unit/test_r.py +++ b/tests/unit/test_r.py @@ -78,8 +78,11 @@ def test_mran_dead(tmpdir, base_image): tmpdir.chdir() with open("runtime.txt", "w") as f: - f.write('r-3.6-2017-06-04') + f.write("r-3.6-2017-06-04") r = buildpacks.RBuildPack(base_image) - with pytest.raises(RuntimeError, match=r'^Microsoft killed MRAN, the source of R package snapshots before 2018-12-07.*'): - r.get_build_scripts() \ No newline at end of file + with pytest.raises( + RuntimeError, + match=r"^Microsoft killed MRAN, the source of R package snapshots before 2018-12-07.*", + ): + r.get_build_scripts()