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

Sustitute {callr} dependency #21

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lorenzwalthert
Copy link

@lorenzwalthert lorenzwalthert commented Jan 9, 2022

To be looked at after #20. This simplifies the dependency graph of {cyclocomp} by removing 3 (heavy) recursive dependencies. This seems possible by leveraging other imported packages. The context of this is to remove these dependencies so {lintr} has a smaller dependency graph, in the light of lorenzwalthert/precommit#356.

library(magrittr)
setwd("~/git/cyclocomp/")
deps <- desc::desc_get_deps() %>%
  dplyr::filter(type == 'Imports') %>%
  dplyr::pull(package) %>%
  c("callr")
recursive_deps_before <- purrr::map(deps, ~names(renv:::renv_package_dependencies(.x))) %>%
  unlist() %>%
  unique()

print(recursive_deps_before)
#>  [1] "processx"  "R6"        "utils"     "callr"     "ps"        "graphics" 
#>  [7] "grDevices" "stats"     "crayon"    "methods"   "rprojroot" "desc"     
#> [13] "tools"     "remotes"   "withr"

deps_after <- desc::desc_get_deps() %>%
  dplyr::filter(type == 'Imports') %>%
  dplyr::pull(package) %>%
  setdiff('callr')


recursive_deps_after <- purrr::map(deps_after, ~names(renv:::renv_package_dependencies(.x))) %>%
  unlist() %>%
  unique()

print(recursive_deps_after)
#>  [1] "graphics"  "utils"     "grDevices" "stats"     "crayon"    "methods"  
#>  [7] "R6"        "rprojroot" "desc"      "tools"     "remotes"   "withr"
setdiff(recursive_deps_before, recursive_deps_after)
#> [1] "processx" "callr"    "ps"

Created on 2022-01-09 by the reprex package (v2.0.1)

cc: @MichaelChirico

@lorenzwalthert lorenzwalthert marked this pull request as draft January 9, 2022 20:12
@lorenzwalthert lorenzwalthert changed the title Drop {callr} dependency Sustitute {callr} dependency Jan 9, 2022
@lorenzwalthert lorenzwalthert marked this pull request as ready for review January 24, 2022 22:32
@IndrajeetPatil
Copy link

@HAlexander23 It would be great if this PR is reviewed soon; packages upstream would really benefit from this change! Thanks.

@gaborcsardi
Copy link
Contributor

For the record, I tried to merge this at gaborcsardi#20 but that will break cyclocomp_package_dir() because if you load the package into the current R session, then the next call to cyclocomp_package_dir() (with the same package) will not work, because you cannot reload the package into the same session.

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

Successfully merging this pull request may close these issues.

3 participants