r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

`Remotes` field on `DESCRIPTION` not compatible between `pak` and `remotes::install_git()` #810

Closed ediferreira11 closed 1 week ago

ediferreira11 commented 1 week ago

Hello,

So far we've been using the remotes package at the company to install our internal packages from Azure DevOps. However, there are some things that haven't been as smooth as I would like and today I was testing pak.

Everything seems to work just fine (great work btw), except the Remotes field on the DESCRIPTION file. I've read on your documentation that when a git:: entry does not end with the package name (e.g. r-pins), we need to add r-pins= before the git:: tag. Even though it is true that this works, that means that when trying to install the package using remotes::install_git(), the installation fails because it doesn't recognize that prefix.

Example below:

Imports:
    pkg123
Remotes:
    git::https://devops-org-name/project-name/_git/pkg123_release

For a package named pkg123 (where the repo is called pkg123_release), the example above would work with the remotes package, but it wouldn't work with pak.

If I change the Remotes to pkg123=git::https://devops-org-name/project-name/_git/pkg123_release now I have the opposite problem, it works for pak but it fails using remotes with the following message:

Error: Unknown remote type: pkg123=git
  object 'pkg123=git_remote' of mode 'function' was not found

Is there anyway to make it compatible with both packages without changing the repository names? I'm asking because I believe some people will still use remotes::install_git() which would no longer work with the changes.

Thank you! I know this is not a reprex but hopefully it is clear enough.

gaborcsardi commented 1 week ago
Remotes: pkg123=git::https://devops-org-name/project-name/_git/pkg123_release

seems to work for me with the dev version of remotes.

ediferreira11 commented 1 week ago

Oh, I'm sorry, I focused so much on pak that I didn't notice I was not using the latest version of remotes. I was on 1.2.4.1 instead of 1.2.5. I will close this issue. Thank you very much for your help!

ediferreira11 commented 1 week ago

Let me just add that maybe it makes sense to add that it is now possible to add the package name on the vignette for remotes (https://remotes.r-lib.org/articles/dependencies.html), even though it has no effect on how it works