Skip to content

fix: only resolve bioc repositories when a project includes a bioc-sourced package#1340

Merged
joshyam-k merged 2 commits into
mainfrom
biocmanager-fix
Jun 29, 2026
Merged

fix: only resolve bioc repositories when a project includes a bioc-sourced package#1340
joshyam-k merged 2 commits into
mainfrom
biocmanager-fix

Conversation

@joshyam-k

Copy link
Copy Markdown
Contributor

Fixes #1337

Instead of eagerly evaluating Bioconductor repositories, only do so when the project actually contains a Bioconductor-sourced package. This PR also creates a isBiocPackage helper that gets reused across R/bundlePackageRenv.R

Following the reproduction steps in #1337:

Before

> rsconnect::writeManifest(appDir = "proj")
ℹ Capturing R dependencies from renv.lock
  Error: invalid version specification 'unknown version: Bioconductor version cannot be validated;
      no internet connection?
      See #troubleshooting section in vignette'

After

> options(repos = c(CRAN = "https://cloud.r-project.org"))
> rsconnect::writeManifest(appDir = "proj")
ℹ Capturing R dependencies from renv.lock
✔ Found 2 dependencies

Comment thread R/bundlePackageRenv.R
bioc <- biocRepos(bundleDir)
if (any(bioc %in% repos)) {
biocPkgs <- NULL
# Only resolve Bioconductor repositories when the project actually contains a

@joshyam-k joshyam-k Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry- I hate when github makes a diff look confusing like this. We're just wrapping the lines that were previously 62-64 and 66-67 with a new hasBiocPackage(...) gate.

@jonkeane jonkeane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I would love to get @karawoo 's take as well, but tests pass and the code looks right.

Comment thread tests/testthat/test-bundlePackageRenv.R Outdated
@joshyam-k joshyam-k merged commit 51f881e into main Jun 29, 2026
18 checks passed
@joshyam-k joshyam-k deleted the biocmanager-fix branch June 29, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants