Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional_repositories to dev_package_deps #783

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* Remotes field accepts explicit package names: `<pkgname>=<type>::<username>/<repo>` (#719, @heavywatal).
* Add `remote_precedence` parameter to `dev_package_deps()` which allows user to choose whether
remote sources should have a priority over cran sources. (#732, @maksymiuks)

* `dev_package_deps()` now works for packages with `Enhances` dependencies
(#711, @maksymiuks).
* Add `additional_repositories` parameter to `dev_package_deps()` which allows user to choose whether
`Additional_repositories` should be extracted from the `DESCRIPTION` file and appended
to repos. (#782, @maksymiuks)

# remotes 2.4.2

Expand Down
7 changes: 5 additions & 2 deletions R/deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#' @param type Type of package to `update`.
#' @param remote_precedence A logical flag specifying whether remote sources should take precedence over
#' CRAN when both were found.
#' @param additional_repositories A logical flag specifying whether `Additional_repositories` should
#' be extracted from the DESCRIPTION and appended to `repos`.
#' @param object A `package_deps` object.
#' @param ... Additional arguments passed to `install_packages`.
#' @inheritParams install_github
Expand Down Expand Up @@ -124,10 +126,11 @@ local_package_deps <- function(pkgdir = ".", dependencies = NA) {
dev_package_deps <- function(pkgdir = ".", dependencies = NA,
repos = getOption("repos"),
type = getOption("pkgType"),
remote_precedence = TRUE) {
remote_precedence = TRUE,
additional_repositories = TRUE) {

pkg <- load_pkg_description(pkgdir)
repos <- c(repos, parse_additional_repositories(pkg))
repos <- c(repos, if (additional_repositories) parse_additional_repositories(pkg))

deps <- local_package_deps(pkgdir = pkgdir, dependencies = dependencies)

Expand Down
6 changes: 5 additions & 1 deletion man/package_deps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading