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

Issue with devtools/remotes for RemoteType "git" #653

Open
banfai opened this issue Jun 24, 2024 · 0 comments
Open

Issue with devtools/remotes for RemoteType "git" #653

banfai opened this issue Jun 24, 2024 · 0 comments

Comments

@banfai
Copy link

banfai commented Jun 24, 2024

When a package have an item in Remotes section of DESCRIPTION with git::https://..., then it gets installed with RemoteType "git" via pak::local_install_dev_deps(). This causes issues with everything in devtools that depend on remotes (e.g. devtools::build_readme()), because remotes does not recognize git as a valid RemoteType (only git2r or xgit).

The issue is triggered when remotes:::package2remote() is called from devtools via remotes.

I've made two test packages, banfai/remotes.pak.test1 and banfai/remotes.pak.test2 that depends on the former.

Here's the reprex of running pak and devtools from the remotes.pak.test2:

pak::local_install_dev_deps()
#> 
#> → Will install 1 package.
#> → All 2 packages (0 B) are cached.
#> + remotes.pak.test1   0.0.0.9000 [bld][cmp]
#> ℹ No downloads are needed, 1 pkg is cached
#> ✔ Installed remotes.pak.test1 0.0.0.9000 (git::https://github.com/banfai/remotes.pak.test1.git@3cfe256) (125ms)
#> ✔ 1 dep: added 1 [4.5s]
devtools::build_readme()
#> ℹ Installing remotes.pak.test2 in temporary library
#> Error in FUN(X[[i]], ...): can't convert package remotes.pak.test1 with RemoteType 'git' to remote
remotes:::package2remote("remotes.pak.test1")
#> Error in remotes:::package2remote("remotes.pak.test1"): can't convert package remotes.pak.test1 with RemoteType 'git' to remote
utils::packageDescription("remotes.pak.test1")
#> Package: remotes.pak.test1
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R: person("First", "Last", , "[email protected]", role =
#>         c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID"))
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#>         license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.3.1
#> NeedsCompilation: no
#> Packaged: 2024-06-24 14:57:27 UTC; banfaib
#> Author: First Last [aut, cre] (YOUR-ORCID-ID)
#> Maintainer: First Last <[email protected]>
#> Built: R 4.4.0; ; 2024-06-24 14:57:27 UTC; windows
#> RemoteType: git
#> RemoteUrl: https://github.com/banfai/remotes.pak.test1.git
#> RemotePkgRef: git::https://github.com/banfai/remotes.pak.test1.git
#> RemoteRef: HEAD
#> RemoteSha: 3cfe256bac615c71382504674821e119a41aae07
#> 
#> -- File: C:/R/R-4.4.0/library/remotes.pak.test1/Meta/package.rds

Created on 2024-06-24 with reprex v2.1.0

I'm not sure if this is a regression of pak, or an issue with remotes, but I didn't want to cross-post it there yet. Please let me know if a remotes issue would be more appropriate.

PS: the test example is a bit contrived, but a realistic usecase of git remote type is e.g. an internal repository on Github Enterprise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant