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

improve R package dependency detections #129

Closed
1 task done
jimbrig opened this issue Jan 4, 2021 · 0 comments · Fixed by #130
Closed
1 task done

improve R package dependency detections #129

jimbrig opened this issue Jan 4, 2021 · 0 comments · Fixed by #130
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@jimbrig
Copy link
Contributor

jimbrig commented Jan 4, 2021

Currently, we rely on automagic to do all the work behind detecting and implementing the process of scanning a directory for R package dependencies and outputting a deps.yaml file.

Note: Packages, as well as their versions/GitHub references, need to be captured

Some issues with this are:

  • Sometimes erroneous R packages are detected due to ::'s being in strings or a package that does not exist being prefixed with :: (i.e. "123::456" or "pkg.name::fname").
  • If there is an error the whole process fails with minimal feedback.

Some definite improvements to do:

  • Add support for wrapping the package detection functions with purrr::safely to not make the whole process fail but rather give feedback as to what failed and why while implementing what works.

Optional ideas for flexibility in the future:

  • support detection of requireNamespace and attachNamesapce calls in code.
  • support projects that use renv or pakrat
  • support projects/apps developed as R packages (i.e. golem) and simply use the DESCRIPTION files dependencies/imports
  • support local R package installations and private Github repository installations
  • Run Shiny App and derive dependencies from sessionInfo()
  • support package installation through an R script (i.e. deps.R) script instead of directly through RUN commands inside Dockerfile

Reference:

  • automagic::make_deps_file()

  • requirements::req_code() and req_namespace()

  • attachment::create_dependencies_file()

  • Consider using the versions package over remotes for better installations.

@jimbrig jimbrig changed the title improve R package dependency detenctions improve R package dependency detections Jan 4, 2021
@jimbrig jimbrig self-assigned this Jan 4, 2021
@jimbrig jimbrig added dependencies Pull requests that update a dependency file enhancement New feature or request jimbrig labels Jan 4, 2021
jimbrig pushed a commit that referenced this issue Jan 4, 2021
for issue #129
- created `get_package_deps`
- ran `devtools::document()` and updated `NAMESPACE` with new imports
@jimbrig jimbrig linked a pull request Jan 4, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant