Skip to content

Commit 0730f4b

Browse files
nbafrankclaude
andcommitted
Release v0.2.18: bump companion package to 0.1.1
Pulls the new uvr-r tarball (commit 2503f7a) so users get update_uvr() on their next sync — closes the v0.2.10 #43 promise that was blocked by the companion repo not having the function on its default branch. Local r-package/ also resynced with the upstream repo: - r_version.R (r_install / r_list / r_use / r_pin) brought in - update_uvr export already present locally - NAMESPACE + uvr-package.Rd union the two function sets Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b4611d6 commit 0730f4b

7 files changed

Lines changed: 68 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/uvr", "crates/uvr-core"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.2.17"
6+
version = "0.2.18"
77
edition = "2021"
88
authors = ["uvr contributors"]
99
license = "MIT"

crates/uvr/src/commands/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ pub async fn install_from_lockfile(
567567

568568
/// Pinned commit SHA and expected SHA-256 hash of the companion R package tarball.
569569
/// Update these together when releasing a new companion version.
570-
const COMPANION_SHA: &str = "4ddd0e991ebd19679b7c0343495250a201820ee4";
571-
const COMPANION_HASH: &str = "820dd6eb191fb4496662de3d524005c1c876206831724d4e2183e60591f4841e";
570+
const COMPANION_SHA: &str = "2503f7a2d3bfa6dd4e5977266444a016638222b6";
571+
const COMPANION_HASH: &str = "3bb74e3e59a24a1244970e529be7b54289c2cc74d3297cab2f8fff9505241ec2";
572572

573573
/// Install the uvr R companion package from GitHub into the project library
574574
/// if it's not already installed. Failures are silently ignored — the companion

r-package/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: uvr
22
Title: R Interface to the 'uvr' Package Manager
3-
Version: 0.1.0
3+
Version: 0.1.1
44
Authors@R: person("Francesco", "Grazzini", role = c("aut", "cre"),
55
email = "francesco@example.com")
66
Description: Provides R functions that wrap the 'uvr' command-line tool for

r-package/NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ export(remove_pkgs)
66
export(sync)
77
export(lock)
88
export(run)
9+
export(r_install)
10+
export(r_list)
11+
export(r_use)
12+
export(r_pin)

r-package/R/r_version.R

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#' Install an R version
2+
#'
3+
#' Downloads and installs a specific R version to \code{~/.uvr/r-versions/}.
4+
#' Equivalent to \code{uvr r install <version>} on the command line.
5+
#'
6+
#' @param version R version string, e.g. \code{"4.4.2"}.
7+
#' @param quiet If \code{TRUE}, suppress output.
8+
#' @return Invisible \code{TRUE} on success.
9+
#' @export
10+
r_install <- function(version, quiet = FALSE) {
11+
run_uvr(c("r", "install", version), quiet = quiet)
12+
}
13+
14+
#' List R versions
15+
#'
16+
#' Shows installed R versions. Use \code{all = TRUE} to show all available
17+
#' versions from CRAN.
18+
#' Equivalent to \code{uvr r list} on the command line.
19+
#'
20+
#' @param all If \code{TRUE}, show all available versions (not just installed).
21+
#' @param quiet If \code{TRUE}, suppress output.
22+
#' @return Invisible \code{TRUE} on success.
23+
#' @export
24+
r_list <- function(all = FALSE, quiet = FALSE) {
25+
args <- c("r", "list")
26+
if (isTRUE(all)) args <- c(args, "--all")
27+
run_uvr(args, quiet = quiet)
28+
}
29+
30+
#' Set the R version constraint
31+
#'
32+
#' Sets the R version constraint in \code{uvr.toml}.
33+
#' Equivalent to \code{uvr r use <version>} on the command line.
34+
#'
35+
#' @param version Version constraint, e.g. \code{">=4.3.0"} or \code{"4.4.2"}.
36+
#' @param dir Optional working directory. Defaults to \code{getwd()}.
37+
#' @param quiet If \code{TRUE}, suppress output.
38+
#' @return Invisible \code{TRUE} on success.
39+
#' @export
40+
r_use <- function(version, dir = NULL, quiet = FALSE) {
41+
run_uvr(c("r", "use", version), dir = dir, quiet = quiet)
42+
}
43+
44+
#' Pin the R version
45+
#'
46+
#' Writes an exact R version to the \code{.r-version} file.
47+
#' Equivalent to \code{uvr r pin <version>} on the command line.
48+
#'
49+
#' @param version Exact R version, e.g. \code{"4.4.2"}.
50+
#' @param dir Optional working directory. Defaults to \code{getwd()}.
51+
#' @param quiet If \code{TRUE}, suppress output.
52+
#' @return Invisible \code{TRUE} on success.
53+
#' @export
54+
r_pin <- function(version, dir = NULL, quiet = FALSE) {
55+
run_uvr(c("r", "pin", version), dir = dir, quiet = quiet)
56+
}

r-package/man/uvr-package.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ with a lockfile, similar to how \code{uv} works for Python.
1717
\item{\code{\link{lock}}}{Re-resolve dependencies and update the lockfile}
1818
\item{\code{\link{run}}}{Run an R script in the project environment}
1919
\item{\code{\link{install_uvr}}}{Install the uvr CLI binary}
20-
\item{\code{\link{update_uvr}}}{Update both R package and CLI binary}
20+
\item{\code{\link{update_uvr}}}{Update both R package and CLI binary in one call}
21+
\item{\code{\link{r_install}}, \code{\link{r_list}}, \code{\link{r_use}}, \code{\link{r_pin}}}{Manage R versions}
2122
}
2223

2324
\strong{Typical workflow:}

0 commit comments

Comments
 (0)