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

As dev, I want create_dependencies_file() to take other sources into account #56

Closed
1 task
statnmap opened this issue Aug 4, 2022 · 1 comment
Closed
1 task
Assignees

Comments

@statnmap
Copy link
Member

statnmap commented Aug 4, 2022

create_dependencies_file() uses DESCRIPTION as source of information.
_Note that DESCRIPTION file can be auto-fill using find_remotes()

Criteria of success

  • If my DESCRIPTION contains
Depends:
    mylocalpackage
Remotes:
    local::mylocalpackage

Then "dependencies_file.R" should looks like this

output

# Remotes ----
install.packages("remotes")
remotes::install_local('mylocalpackage')
# Attachments ----
to_install <- c("cli", "config", "DBI", "dplyr", "glue", "golem", "htmltools", "knitr", "mylocalpackage", "magrittr", "purrr", "readr", "readxl", "rmarkdown", "shiny", "shinythemes", "stringdist", "stringr", "tibble", "tidyr", "writexl")
  for (i in to_install) {
    message(paste("looking for ", i))
    if (!requireNamespace(i)) {
      message(paste("     installing", i))
      install.packages(i)
    }
  }

And NOT like today:

# Remotes ----
install.packages("remotes")
remotes::install_github('local::mylocalpackage')
# Attachments ----
to_install <- c("cli", "config", "DBI", "dplyr", "glue", "golem", "htmltools", "knitr", "mylocalpackage", "magrittr", "purrr", "readr", "readxl", "rmarkdown", "shiny", "shinythemes", "stringdist", "stringr", "tibble", "tidyr", "writexl")
  for (i in to_install) {
    message(paste("looking for ", i))
    if (!requireNamespace(i)) {
      message(paste("     installing", i))
      install.packages(i)
    }
  }

Technicals

  • I think that listing all packages with their version with install_version() is not reliable, because of versions of sub-dependencies. I would recommend to redirect users to {renv} and create the Dockerfile using {renv}.
  • At least, what is interesting is to list deps coming from GitHub, GitLab, etc... Except that remotes::install_deps() does read the DESCRIPTION correctly. Just need to use set_remotes_to_desc() during the process to be sure DESCRIPTION file is up-to-date.
@MurielleDelmotte MurielleDelmotte changed the title create_dependencies_file() should take other sources into account As dev, I want that create_dependencies_file() take other sources into account Mar 21, 2023
@MurielleDelmotte MurielleDelmotte changed the title As dev, I want that create_dependencies_file() take other sources into account As dev, I want create_dependencies_file() to take other sources into account Mar 21, 2023
@MurielleDelmotte MurielleDelmotte self-assigned this Mar 21, 2023
MurielleDelmotte added a commit that referenced this issue Mar 21, 2023
why:
- take in account the local package

what:
- Move in flat the function create_dependencies_file (test + doc + example)
- Improve function to take in account local package

Issue #56
MurielleDelmotte added a commit that referenced this issue Mar 27, 2023
why:
- take in account other source package

what:
- Complete function to take in account other source package (git, gitlab, github, bioc, local)
- add unit test

Issue #56
MurielleDelmotte added a commit that referenced this issue Mar 27, 2023
why:
- upgrade version 0.3.1.9000

what:
- update NEWS and DESCRIPTION

Issue #56
@ExaminateurThinkR
Copy link

ok

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

4 participants