Skip to content

WISH: install_*() to return name of package installed #55

Closed

Description

@HenrikBengtsson

Not all GitHub repositories are named the same way as the R package they install, e.g.

> res <- remotes::install_github("satijalab/seurat")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo satijalab/seurat@master
Installing package into '/home/hb/R/x86_64-pc-linux-gnu-library/3.3'
(as 'lib' is unspecified)
* installing *source* package ‘Seurat’ ...
** libs
[...]
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (Seurat)

> res
[1] TRUE

Note, this installs package Seurat (capitalized).

Would it make sense to have the function return the name of the package installed instead of TRUE? (Not sure if remotes ever knows about the package name or not).

Also, and just guessing, but I don't think you can ever get anything else than TRUE returned. For instance, if the repos doesn't exist, you get an error:

> res <- remotes::install_github("satijalab/non_existing_repos")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo satijalab/non_existing_repos@master
Error in utils::download.file(url, path, method = download_method(), quiet = quiet,  : 
  cannot download all files

Activity

  1. changed the title [-]WISH:install_*() to return name of package installed[/-] [+]WISH: install_*() to return name of package installed[/+] on Feb 23, 2017
  2. gaborcsardi commented on Feb 23, 2017

    @gaborcsardi
    Member

    👍

    Great idea! I think it should (ideally) even return some more elaborate structure that includes what exactly happened during install.

    But the thing is, we will rewrite the dependency resolution and package download process (hopefully) soon, so I will not add this feature now.

  3. jeroen commented on May 5, 2017

    @jeroen
    Member

    @gaborcsardi @HenrikBengtsson what would be a temporary workaround that gives me the name of the package installed by install_github() with the current version of devtools / remotes ?

  4. gaborcsardi commented on May 5, 2017

    @gaborcsardi
    Member

    I am afraid that you need to download it:

    p <- devtools:::github_remote("wesm/feather/R")
    pkg <- devtools:::remote_download(p)

    and then unzip DESCRIPTION and look inside with desc or read.dcf.

  5. jeroen commented on May 5, 2017

    @jeroen
    Member

    Can I feed pkg back to install to avoid downloading twice?

  6. gaborcsardi commented on May 5, 2017

    @gaborcsardi
    Member
  7. added a commit that references this issue on Aug 28, 2018
    b89b297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions