{"id":14066580,"url":"https://github.com/analythium/deps","last_synced_at":"2026-02-26T18:12:35.403Z","repository":{"id":108483968,"uuid":"516949039","full_name":"analythium/deps","owner":"analythium","description":"Dependency Management with roxygen-style Comments","archived":false,"fork":false,"pushed_at":"2025-01-22T04:56:22.000Z","size":2354,"stargazers_count":34,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T10:59:59.710Z","etag":null,"topics":["dependencies","packages","reproducibility","rstats"],"latest_commit_sha":null,"homepage":"https://hub.analythium.io/deps/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analythium.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-23T03:37:43.000Z","updated_at":"2025-10-06T09:39:22.000Z","dependencies_parsed_at":"2023-05-22T10:00:30.972Z","dependency_job_id":"25b2c667-6d63-446d-8366-d5d2a3c5eebf","html_url":"https://github.com/analythium/deps","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/analythium/deps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fdeps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fdeps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fdeps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fdeps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analythium","download_url":"https://codeload.github.com/analythium/deps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fdeps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29867197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T16:38:37.846Z","status":"ssl_error","status_checked_at":"2026-02-26T16:37:58.932Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependencies","packages","reproducibility","rstats"],"created_at":"2024-08-13T07:05:10.323Z","updated_at":"2026-02-26T18:12:35.385Z","avatar_url":"https://github.com/analythium.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: gfm\n---\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  eval = FALSE,\n  comment = \"#\",\n  fig.path = \"README-\"\n)\nset.seed(0)\n#knitr::opts_knit$set(root.dir = 'inst/examples')\n```\n\n# deps\n\n\u003e Dependency Management with 'roxygen'-Style Comments\n\nManage your source code dependencies by decorating your existing R code with special, 'roxygen'-style comments.\n\n[![Build status](https://github.com/analythium/deps/actions/workflows/check.yml/badge.svg)](https://github.com/analythium/deps/actions)\n[![CRAN version](http://www.r-pkg.org/badges/version/deps)](https://CRAN.R-project.org/package=deps)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/deps)](https://hub.analythium.io/deps/)\n\n\n```R\n#' @repo deps https://analythium.r-universe.dev\ninstall.packages(\"deps\", repos = \"https://analythium.r-universe.dev\")\n\n#' @remote analythium/deps\nremotes::install_github(\"analythium/deps\")\n```\n\n## Why this package?\n\nThere are many similar packages out there, some aimed at reproducibility\n([packrat](https://CRAN.R-project.org/package=packrat),\n[Require](https://CRAN.R-project.org/package=Require),\n[switchr](https://cran.r-project.org/package=switchr),\n[versions](https://CRAN.R-project.org/package=versions),\n[renv](https://CRAN.R-project.org/package=renv),\n[capsule](https://github.com/MilesMcBain/capsule)).\nOthers are focused on dependency management\n([remotes](https://CRAN.R-project.org/package=remotes),\n[pak](https://CRAN.R-project.org/package=pak)).\n\n**So why do we need another one?**\n\nFull reproducibility is an important and heavyweight aspiration that either needs locally cached package libraries, or an accurate snapshot mirroring the local system (i.e. exactly where the package was installed from). Full reproducibility is often required for reports, markdown based documents, scripts. _A loosely defined project that is combined with strict versioning requirements, often erring on the side of \"more dependencies are safer\"._\n\nAs opposed to this, package-based development is the main use case for dependency management oriented packages. In this case, exact versions are only managed to the extent of avoiding breaking changes (given that testing can surface these). _A package focused workflow combined with a \"no breaking changes\" philosophy to version requirements, leading to leaner installation._\n\nWhat if you wanted to combine the best of both approaches? _A loosely defined project with just strict-enough versioning requirements_ -- and all this without having to write a `DESCRIPTION` file. Because why would you need a `DESCRIPTION` file when you have no package? Also, a `DESCRIPTION` file won't let you to pin an exact the package version or to specify alternate CRAN-like repositories...\n\nThe answer is deps: **you add comments to your code, deps does the rest**.\n\n```{r}\n#' @remote analythium/rconfig@CRAN-v0.1.3\nrconfig::config()\n\n#' @repo sf https://r-spatial.r-universe.dev\nlibrary(sf)\n\n#' @ver rgl 0.108.3\nlibrary(rgl)\n```\n\nOnce you decorated your code, you can call `deps::create()` to write your `dependencies.json` file.\n\nUse `deps::install()` to install dependencies based on scanning a project folder or using and existing `dependencies.json` file.\n\n## What deps does\n\nRequired packages are found using the [`renv::dependencies()`](https://rstudio.github.io/renv/reference/dependencies.html) function. System dependencies can be specified as well, but are not actively sought out.\n\nThe packages list found by `renv::dependencies()` is refined and modified by 'roxygen'-style comments. But the packages need to be declared/used somewhere in the source code for the comments to take effect.\n\nIf no comment is provided for a given package, its source is assumed to be a CRAN repository, and its version to be the latest given the repositories used at the time of installation.\n\n## Tags\n\nTags are part of the ['roxygen'-style comments](https://cran.r-project.org/package=roxygen2):\n\n```{r}\n#' @\u003ctag\u003e \u003cparameter\u003e\n```\n\nwhere `#'` is followed by space, the tag starting with `@`, space, and some parameters.\n\ndeps implements the following tags:\n\n| Tag   | Description | Usage |\n|-------|-------|---------|\n| `@sys`  | System requirement(s) | `@sys req1,req2,...` |\n| `@remote`  | Remote source(s) | `@remote remote1,remote2,...` |\n| `@local`  | Local source(s) | `@local path1,path2,...` |\n| `@ver`  | Versioned package | `@ver pkg version` |\n| `@dev`  | Development package(s) | `@dev pkg1,pkg2,...` |\n| `@repo`  | CRAN-like source | `@repo pkg repo` |\n| `@repos`  | Global CRAN-like repo(s) | `@repos repo1,repo2,...` |\n| `@rver`  | R version | `@rver 4.1.3` |\n\n#### System requirements\n\nKnown system requirements can be declared using the `@sys` tag, packages can be separated by commas:\n\n```{r}\n#' @sys curl,git\n```\n\nThese packages are added to the list of requirements for the non-development packages.\n\n#### Remote sources\n\nRemotely sourced packages are declared using the `@remote`tag following the [`remotes`](https://CRAN.R-project.org/package=remotes/vignettes/dependencies.html) specifications:\n\n```{r}\n#' @remote analythium/rconfig@CRAN-v0.1.3\nrconfig::config()\n```\n\nThis is effectively a version pinning for remotely sourced packages.\n\n#### Local packages\n\nThe `@local` tag can be used to provide a path to local directory, or compressed file (tar, zip, tar.gz, tar.bz2, tgz2, or tbz) to install packages from:\n\n```{r}\n#' @local mypackage_0.1.0.tar.gz\nlibrary(mypackage)\n```\n\nThis is effectively the same as:\n\n```{r}\n#' @remote local::mypackage_0.1.0.tar.gz\nlibrary(mypackage)\n```\n\n#### Development packages\n\nDev packages following the `@dev` decorator are excluded from installation, but are not removed if already installed:\n\n```{r}\n#' @dev devtools,roxygen2\nrequireNamespace(\"devtools\")\n```\n\n#### Alternative repos\n\nUse the `@repo` tag to specify an alternative CRAN-like repository, e.g. from the [r-universe](https://r-universe.dev/):\n\n```{r}\n#' @repo intrval https://psolymos.r-universe.dev\nlibrary(intrval)\n```\n\nUse the `@repos` tag to set CRAN-like repositories for all package installation:\n\n```{r}\n#' @repos http://cran.r-project.org,https://psolymos.r-universe.dev\n```\n\n#### Versioned packages\n\nWhen CRAN packages require specific a version, use the `@ver` tag according to the [`remotes::install_version()`](https://remotes.r-lib.org/reference/install_version.html) function specifications:\n\n```{r}\n#' @ver mefa4 \u003e= 0.3-0\nlibrary(mefa4)\n```\n\n#### R version\n\nR version declared using the `@rver` tag is recorded, but this information is not used during installation. The R version can be a major (`3`), a major-minor (`3.6`) or a major-minor-patch (`3.6.3`) version. When the version is partially specified, the highest minor/patch version will be used. Use dots as separators.\n\n## Usage\n\nThe `create()` function will crawl the project directory for package dependencies. It will amend the dependency list and package sources based on the comments. The summary is written into the `dependencies.json` file. Optionally, the system requirements are written into the `dependencies.json` file as well.\n\n`install()` will look for the `dependencies.json` file in the root of the  project directory and perform dependency installation if the file exists. If the file does not exist, it uses `create()` to create that file before attempting installation but removes the `dependencies.json` file afterwards, leaving no trace.\n\n## deps-cli\n\nA CLI example is given in [`inst/examples/03-cli`](./inst/examples/03-cli/):\n\n```bash\ncp inst/examples/03-cli/deps-cli.R /usr/local/bin/deps-cli\nchmod +x /usr/local/bin/deps-cli\n```\n\nYou can download the CLI script from the web, it will install deps and other\nrequired R packages on its first usage:\n\n```bash\ncurl -fsSL https://hub.analythium.io/deps/deps-cli.R -o /usr/local/bin/deps-cli\nchmod +x /usr/local/bin/deps-cli\n```\n\nUsage of the CLI as explained in `deps-cli help`:\n\n```\n🚀 Quickly install R package dependencies on the command line\n\n👉 MIT (c) Analythium Solutions Inc. 2022-2023\n          _                           _ _ \n       __| | ___ _ __  ___        ___| (_)\n      / _` |/ _ \\ '_ \\/ __|_____ / __| | |\n     | (_| |  __/ |_) \\__ \\_____| (__| | |\n      \\__,_|\\___| .__/|___/      \\___|_|_|\n                |_|                       \n\n🔗 See https://github.com/analythium/deps\n\ndeps-cli is based on deps 0.1.2 2023-03-23 \n\nUsage: deps-cli \u003ccommand\u003e [options]\n\nCommands:\n  deps-cli help         Print usage and exit\n  deps-cli version      Print version and exit\n  deps-cli create       Scan DIR and write dependencies.json\n  deps-cli sysreqs      Install system requirements\n  deps-cli install      Install R package dependencies\n  deps-cli all          create \u0026 sysreqs \u0026 install in one go\n\nOptions:\n  --dir DIR             Directory to scan, defaults to .\n  --upgrade             Upgrade package dependencies\n  --silent              Silent, no info printed\n\nExamples:\n  deps-cli help\n  deps-cli version\n  deps-cli create\n  deps-cli create --silent\n  deps-cli sysreqs\n  deps-cli install --dir /root/app\n  deps-cli all --dir /root/app --upgrade\n```\n\nAnalyze dependencies, install system and R dependencies in 1 line:\n\n```bash\ndeps all\n\n# same as\ndeps-cli create \u0026\u0026 deps-cli sysreqs \u0026\u0026 deps-cli install\n```\n\n`deps-cli install` looks for the following files before attempting to detect dependencies: `renv.lock`, `pkg.lock`, and `DESCRIPTION`.\n\nIn a Dockerfile you can:\n\n```Dockerfile\nFROM rocker/r2u:24.04\nRUN install.r remotes renv pak rconfig jsonlite yaml deps\nRUN installGithub.r analythium/deps\nRUN cp -p $(R RHOME)/site-library/deps/examples/03-cli/deps-cli.R /usr/local/bin/deps-cli\nRUN chmod +x /usr/local/bin/deps-cli\n\nCOPY ... # your files\n\nRUN deps-cli all\n...\n```\n\nOr simply use the [`ghcr.io/analythium/deps:latest`](https://github.com/analythium/deps/pkgs/container/deps) as your parent image where the `deps-cli` is already installed:\n\n```Dockerfile\nFROM ghcr.io/analythium/deps:latest\n...\n```\n\n## Examples\n\nSee the [`inst/examples`](./inst/examples/) folder for more examples.\n\n## Notes\n\nThe deps package uses a 5 minutes timeout for downloads instead of the default 1 minute (`getOption(\"timeout\")`). When the timeout option or the `R_DEFAULT_INTERNET_TIMEOUT` environment variable is set to a \u003e5 minutes value, it will be respected and timeout will be set to the maximum of the three possible values.\n\nThe `create()` function prompts the user asking confirmation before writing the `dependencies.json` file. Use `create(ask = FALSE)` to bypass the prompt.\n\n## License\n\n[MIT License](./LICENSE) © 2022-2023 Peter Solymos and Analythium Solutions Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Fdeps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalythium%2Fdeps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Fdeps/lists"}