You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package dependency installation for subdirectories in GIT #777
I have some R packages in my companies repo. But they are not in the root path but in a subdirectory. I can easly install this packages using the subdir argument in remotes::install_git. However I do not know how to correctly specify the sub-directory in the Remotes section of the DESCRIPTION file.
All works find if each package is in one corresponding git repos using :
Hi @gaborcsardi thanks for sharing that sub-directories are currently not supported by remotes. As I'm not very familiar with pak, would a implementation of : as delimiter for subdirectories indeed fix the problem of specifying package dependencies in the DESCRIPTION file of a package?
Regarding my upper question you stated, that it is currently not possible to add a sub-directory GIT sources to the Remotes in a DESCRIPTION file of a package. Is there any chance this is possible in future releases? Further I don't quite get (as I'm not really familiar with pak ) how this:
It is unlikely that we would implement this in remotes, but we could implement it in pak.
Thanks @gaborcsardi. As I used used renv:install before I just played around a little with pak:pgk_install. I was able to install a package without any dependencies from azure. However if I try a package with dependencies I run into following error:
Error:!errorinpaksubprocessCausedbyerror:!Couldnotsolvepackagedependencies:*git::https://dev.azure.com/<company>/<department>/_git/<package>:*Can't install dependency <package dep 1> (>= 0.1.3) (>= 0.0.3) (>= 0.0.2) * Can'tinstalldependency<packagedep2> (>=0.0.3) (>=0.0.2)
*Can't install dependency <package dep 3> (>= 0.0.2)* <package dep 1>: Can'tfindpackagecalled<packagedep1>, <packagedep2>, <packagedep3>, <packagedep4>.*<packagedep2>:Can't find package called <package dep 1>, <package dep 2>, <package dep 3>, <package dep 4>.* <package dep 3>: Can'tfindpackagecalled<packagedep1>, <packagedep2>, <packagedep3>, <packagedep4>.---Backtrace:1.pak::pkg_install("git::https://dev.azure.com/<company>/<department>/_git/<package>?reinstall")
2.pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), …
3.err$throw(res$error)
---Subprocessbacktrace:1.base::withCallingHandlers(cli_message=function(msg) { …
2. get("pkg_install_make_plan", asNamespace("pak"))(...)
3.prop$stop_for_solution_error()
4.private$plan$stop_for_solve_error()
5.pkgdepends:::pkgplan_stop_for_solve_error(self, private)
6.base::throw(new_error("Could not solve package dependencies:\n", msg, …
7.|base::signalCondition(cond)
8. global (function (e) …
what I still don't get is the link between the pak package and this vignette. Is pak:pgk_install able to make use of Remotes in a packages DESCRIPTION file? If yes I wonder why renv:install does work but pak:pgk_install not....
what I still don't get is the link between the pak package and this vignette. Is pak:pgk_install able to make use of Remotes in a packages DESCRIPTION file?
Thanks for sharing! I have currently 2 repos each containing exactly one package. Let's say: https://dev.azure.com/<company>/<department>/_git/pkgA
and https://dev.azure.com/<company>/<department>/_git/pkgB
pkgB has a dependency of pkgA which is specified as following in package pkgBDESCRIPTION file:
Yes, AFAICT that should work, provided that you have the credentials to access these repositories in the git credential store, and you are not running into this bug: r-lib/pkgdepends#319
Ok thanks. As I have successfully installed pkgA using pak::pkg_install, there shouldn't be any problems with the authentication I guess. But anyway, thanks for confirming that I used the right specification in DESCRIPTION...
Activity
gaborcsardi commentedon Nov 13, 2023
I am afraid that there is no way to do that currently.
kevinushey commentedon Nov 13, 2023
For what it's worth, in
renv, we've adopted the convention of using:to delimit sub-directories. I added my rationale here:rstudio/renv#497 (comment)
Is this something that
remotescould also accept?gaborcsardi commentedon Nov 13, 2023
It is unlikely that we would implement this in remotes, but we could implement it in pak.
siri16100 commentedon Nov 14, 2023
Hi @gaborcsardi thanks for sharing that sub-directories are currently not supported by
remotes. As I'm not very familiar withpak, would a implementation of:as delimiter for subdirectories indeed fix the problem of specifying package dependencies in theDESCRIPTIONfile of a package?gaborcsardi commentedon Nov 14, 2023
I am sorry, I am not sure what you mean.
siri16100 commentedon Nov 14, 2023
Regarding my upper question you stated, that it is currently not possible to add a sub-directory GIT sources to the
Remotesin aDESCRIPTIONfile of a package. Is there any chance this is possible in future releases? Further I don't quite get (as I'm not really familiar withpak) how this:would help solving the issue?
gaborcsardi commentedon Nov 14, 2023
As we are focusing on pak, we are not adding new features to remotes, so it is unlikely.
You could use pak instead of remotes as it is mostly superior to remotes.
siri16100 commentedon Nov 14, 2023
Thanks @gaborcsardi. As I used used
renv:installbefore I just played around a little withpak:pgk_install. I was able to install a package without any dependencies from azure. However if I try a package with dependencies I run into following error:what I still don't get is the link between the
pakpackage and this vignette. Ispak:pgk_installable to make use of Remotes in a packages DESCRIPTION file? If yes I wonder whyrenv:installdoes work butpak:pgk_installnot....gaborcsardi commentedon Nov 14, 2023
Yes: https://pak.r-lib.org/reference/pak_package_sources.html#the-remotes-field
Hard to say without seeing your
DESCRIPTIONfile and knowing the layout of your git repos, unfortunately.siri16100 commentedon Nov 14, 2023
Thanks for sharing! I have currently 2 repos each containing exactly one package. Let's say:
https://dev.azure.com/<company>/<department>/_git/pkgAand
https://dev.azure.com/<company>/<department>/_git/pkgBpkgBhas a dependency ofpkgAwhich is specified as following in packagepkgBDESCRIPTIONfile:gaborcsardi commentedon Nov 14, 2023
Yes, AFAICT that should work, provided that you have the credentials to access these repositories in the git credential store, and you are not running into this bug: r-lib/pkgdepends#319
siri16100 commentedon Nov 14, 2023
Ok thanks. As I have successfully installed
pkgAusingpak::pkg_install, there shouldn't be any problems with the authentication I guess. But anyway, thanks for confirming that I used the right specification inDESCRIPTION...