diff --git a/docs/source/howto/languages.rst b/docs/source/howto/languages.rst index abf76e0a1..75ea7e537 100644 --- a/docs/source/howto/languages.rst +++ b/docs/source/howto/languages.rst @@ -66,11 +66,11 @@ by adding a :ref:`install.R` file to your repo. RStudio and IRKernel installed by default for all R versions. If you request R 4.1 or later, or specify a snapshot date newer than -``2022-01-01``, `packagemanager.rstudio.com `_ +``2022-01-01``, `packagemanager.posit.co `_ will be used to provide much faster installations via `binary packages `_. For *some* packages, this might require you install underlying system libraries using :ref:`apt.txt` - look at the page for the CRAN package you are interested in at -`packagemanager.rstudio.com `_ to find +`packagemanager.posit.co `_ to find a list. For older R versions with an older snapshot date, `MRAN `_ diff --git a/repo2docker/buildpacks/r.py b/repo2docker/buildpacks/r.py index 03aa4ae61..26190c742 100644 --- a/repo2docker/buildpacks/r.py +++ b/repo2docker/buildpacks/r.py @@ -22,8 +22,8 @@ class RBuildPack(PythonBuildPack): Where 'year', 'month' and 'date' refer to a specific date whose CRAN snapshot we will use to fetch packages. - Uses https://packagemanager.rstudio.com, or MRAN if no snapshot - is found on packagemanager.rstudio.com + Uses https://packagemanager.posit.co, or MRAN if no snapshot + is found on packagemanager.posit.co 2. A `DESCRIPTION` file signaling an R package @@ -204,7 +204,7 @@ def get_packages(self): def get_rspm_snapshot_url(self, snapshot_date, max_days_prior=7): for i in range(max_days_prior): snapshots = requests.post( - "https://packagemanager.rstudio.com/__api__/url", + "https://packagemanager.posit.co/__api__/url", # Ask for midnight UTC snapshot json={ "repo": "all", @@ -216,11 +216,11 @@ def get_rspm_snapshot_url(self, snapshot_date, max_days_prior=7): # Construct a snapshot URL that will give us binary packages for Ubuntu Bionic (18.04) if "upsi" in snapshots: return ( - "https://packagemanager.rstudio.com/all/__linux__/bionic/" + "https://packagemanager.posit.co/all/__linux__/bionic/" + snapshots["upsi"] ) raise ValueError( - "No snapshot found for {} or {} days prior in packagemanager.rstudio.com".format( + "No snapshot found for {} or {} days prior in packagemanager.posit.co".format( snapshot_date.strftime("%Y-%m-%d"), max_days_prior ) ) @@ -229,7 +229,7 @@ def get_rspm_snapshot_url(self, snapshot_date, max_days_prior=7): def get_mran_snapshot_url(self, snapshot_date, max_days_prior=7): for i in range(max_days_prior): try_date = snapshot_date - datetime.timedelta(days=i) - # Fall back to MRAN if packagemanager.rstudio.com doesn't have it + # Fall back to MRAN if packagemanager.posit.co doesn't have it url = f"https://mran.microsoft.com/snapshot/{try_date.isoformat()}" r = requests.head(url) if r.ok: @@ -258,11 +258,11 @@ def get_devtools_snapshot_url(self): devtools is part of our 'core' base install, so we should have some control over what version we install here. """ - # Picked from https://packagemanager.rstudio.com/client/#/repos/1/overview + # Picked from https://packagemanager.posit.co/client/#/repos/1/overview # Hardcoded rather than dynamically determined from a date to avoid extra API calls - # Plus, we can always use packagemanager.rstudio.com here as we always install the + # Plus, we can always use packagemanager.posit.co here as we always install the # necessary apt packages. - return "https://packagemanager.rstudio.com/all/__linux__/bionic/2022-01-04+Y3JhbiwyOjQ1MjYyMTU7NzlBRkJEMzg" + return "https://packagemanager.posit.co/all/__linux__/bionic/2022-01-04+Y3JhbiwyOjQ1MjYyMTU7NzlBRkJEMzg" @lru_cache() def get_build_scripts(self): diff --git a/tests/r/r4.0-rspm/verify b/tests/r/r4.0-rspm/verify index 21bac29d8..835f141c0 100755 --- a/tests/r/r4.0-rspm/verify +++ b/tests/r/r4.0-rspm/verify @@ -8,6 +8,6 @@ if (!(version$major == "4" && as.double(version$minor) >= 0 && as.double(version } # The date we have chosen should give us an rspm mirror -if (!(startsWith(options()$repos["CRAN"], "https://packagemanager.rstudio.com"))) { +if (!(startsWith(options()$repos["CRAN"], "https://packagemanager.posit.co"))) { quit("yes", 1) -} \ No newline at end of file +} diff --git a/tests/unit/test_r.py b/tests/unit/test_r.py index a5d7db7c0..7f7e5a0e1 100644 --- a/tests/unit/test_r.py +++ b/tests/unit/test_r.py @@ -26,7 +26,7 @@ def test_version_completion(tmpdir): tmpdir.chdir() with open("runtime.txt", "w") as f: - f.write(f"r-3.6-2019-01-01") + f.write("r-3.6-2019-01-01") r = buildpacks.RBuildPack() assert r.r_version == "3.6.3" @@ -52,7 +52,7 @@ def test_mran_date(tmpdir, runtime, expected): def test_snapshot_rspm_date(): test_dates = { - # Even though there is no snapshot specified in the interface at https://packagemanager.rstudio.com/client/#/repos/1/overview + # Even though there is no snapshot specified in the interface at https://packagemanager.posit.co/client/#/repos/1/overview # For 2021 Oct 22, the API still returns a valid URL that one can install # packages from - probably some server side magic that repeats our client side logic. # No snapshot for this date from @@ -65,7 +65,7 @@ def test_snapshot_rspm_date(): for requested, expected in test_dates.items(): snapshot_url = r.get_rspm_snapshot_url(requested) assert snapshot_url.startswith( - "https://packagemanager.rstudio.com/all/__linux__/bionic/" + "https://packagemanager.posit.co/all/__linux__/bionic/" + expected.strftime("%Y-%m-%d") )