https://github.com/insightsengineering/verdepcheck
An R package that tests your R package against the min/max versions of specified dependencies
https://github.com/insightsengineering/verdepcheck
check devtools r testing utils
Last synced: about 1 year ago
JSON representation
An R package that tests your R package against the min/max versions of specified dependencies
- Host: GitHub
- URL: https://github.com/insightsengineering/verdepcheck
- Owner: insightsengineering
- License: other
- Created: 2023-02-15T15:28:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-19T03:49:19.000Z (over 1 year ago)
- Last Synced: 2025-03-26T12:51:14.182Z (about 1 year ago)
- Topics: check, devtools, r, testing, utils
- Language: R
- Homepage: https://insightsengineering.github.io/verdepcheck/
- Size: 721 KB
- Stars: 7
- Watchers: 5
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# verdepcheck
Have you ever encounter following errors?
```r
Error: object ‘foo’ is not exported by 'namespace:bar'
```
```r
`foo()` was deprecated in bar 1.0.0.
i Please use `baz()` instead.
```
This package is a tool for package developers to check your package using various versions of dependencies. It will help you detect new breaking changes of dependencies as well as the minimal version supported.
## Overview
Typical workflow includes the following:
- read local package dependencies from the `DESCRIPTION` file using dedicated `Config/Needs/verdepcheck` field
- derive dependencies version from `Imports` and `Suggests` according to the strategy used
- resolve and identify potential conflicts of dependencies
- download and install to the temporary directory
- execute `R CMD CHECK` using directory from the previous step as a library path
Supported strategies are:
- `max` - use the greatest version of dependent packages. Please note that using development version is not guaranteed to be stable.
- `release` - use the released version of dependent packages. It will try use CRAN if possible else if GitHub release is available then use it else fail.
- `min_cohort` - find maximum date of directly dependent packages release dates and use that as PPM snapshot date for dependency resolve.
- `min_isolated` - for each direct dependency: find its release date and use it as PPM snapshot for resolving itself. Next, combine all the individual resolutions and resolve it altogether again.
The main functions are:
- `new__deps_installation_proposal` for creating `installation_proposal` objects
- `_deps_check` that creates and executes `installation_proposal` and then run `"R CMD CHECK"`
This package is heavily based on [`pkgdepends`](https://r-lib.github.io/pkgdepends/) for dependency resolution and [`rcmdcheck`](https://rcmdcheck.r-lib.org/) for executing `"R CMD CHECK"`.
## Install
```r
devtools::install_github("insightsengineering/verdepcheck")
```
## Usage
The main goal of package authors is to use it within GitHub Action or any other CI tool. See [r-verdepcheck-action](https://github.com/insightsengineering/r-verdepcheck-action).
```r
x <- max_deps_check("(path to your package)")
# print results for debugging
x$ip$show_solution()
x$ip$draw()
# create artifact
x$ip$create_lockfile("/path/to/pkg.lock")
# print R CMD CHECK results
x$check$session_info
x$check$status
```