Reputation: 322
I've created two R packages.
Now I'm in a situation in which I need package2
to rely on package1
.
In the project for package2
, I've run this line of code:
usethis::use_dev_package(package = "package1", type = "Imports", remote = "gitlab::my_gitlab_name")
which updates the DESCRIPTION file to read the following:
Package: package2
Title: My Package title
Version: 0.0.0.9000
Authors@R:
person(given = "My",
family = "Name",
role = c("aut", "cre"),
email = "myname@myemail.com")
Description: My package does somethings.
License: file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
Imports:
data.table,
dplyr,
package1 (>= 0.0.0.9000)
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Remotes:
gitlab::my_gitlab_name
However, when I try to install the package by running this:
devtools::install()
I get the following error:
Error in utils::download.file(url, path, method = method, quiet = quiet, :
cannot open URL 'https://gitlab.com/api/v4/projects/my_gitlab_name%2Fpackage1/repository/commits/HEAD'
FYI, I've also tried the following, with no success (I get the same error no matter what):
usethis::use_dev_package(package = "package1", type = "Imports", remote = "my_gitlab_name/package1")
usethis::use_dev_package(package = "package1", type = "Imports", remote = "my_gitlab_name")
usethis::use_dev_package(package = "package1", type = "Imports", remote = "my_gitlab_name/package1")
usethis::use_dev_package(package = "package1", type = "Imports", remote = "gitlab::my_gitlab_name/package1")
In short, I'd like to know how to add a gitlab developer library as an import for a package.
Does anyone know what I'm missing here? Your help would be much appreciated.
My apologies for not providing a reproducible example, the packages in question are both proprietary to my company.
Upvotes: 1
Views: 201