Skip to content

Commit

Permalink
fix #21, fix compatibility issues, fix broken urls + badges (PR #19)
Browse files Browse the repository at this point in the history
- Fix aliasing for package manual entry (#21).
- Fix compatibility with updates to _ggplot2_ package.
- Fix compatibility with updates to package citation format.
- Fix broken URLs in package documentation.
- Fix broken badges in README.
  • Loading branch information
jeffreyhanson authored May 26, 2024
1 parent abc9a6a commit dbe2eca
Show file tree
Hide file tree
Showing 172 changed files with 1,936 additions and 1,316 deletions.
65 changes: 24 additions & 41 deletions .github/workflows/R-CMD-check-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,32 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
cache-version: 1
extra-packages: |
cran/XML
any::remotes
any::covr
any::rcmdcheck
gurobi=?ignore
Rsymphony=?ignore
lpsymphony=?ignore
ggtree=?ignore
- name: Install additional packages
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
options("install.packages.compile.from.source" = "never")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
options(repos = "https://cloud.r-project.org/")
remotes::install_cran("Rsymphony")
remotes::install_bioc("lpsymphony")
remotes::install_bioc("ggtree")
shell: Rscript {0}

- name: Session information
Expand All @@ -81,19 +72,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
83 changes: 43 additions & 40 deletions .github/workflows/R-CMD-check-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
matrix:
config:
- {os: ubuntu-20.04, r: 'release', pkgs: 'all'}
- {os: ubuntu-20.04, r: 'devel', pkgs: 'all'}
- {os: ubuntu-20.04, r: 'devel', pkgs: 'depends only'}
# - {os: ubuntu-20.04, r: 'devel', pkgs: 'all'}
# - {os: ubuntu-20.04, r: 'devel', pkgs: 'depends only'}

env:
_R_REMOTES_NO_ERRORS_FROM_WARNINGS_: true
Expand All @@ -39,40 +39,36 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-cache-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-cache-
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- name: Install system dependencies
run: |
sudo apt-get -y install libcurl4-openssl-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
sudo apt-get install libxml2 coinor-libsymphony-dev
- name: Install dependencies
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 4
extra-packages: |
cran/XML
any::remotes
any::covr
any::rcmdcheck
gurobi=?ignore
Rsymphony=?ignore
lpsymphony=?ignore
ggtree=?ignore
- name: Install additional packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
options(repos = "https://cloud.r-project.org/")
remotes::install_cran("Rsymphony")
remotes::install_bioc("lpsymphony")
remotes::install_bioc("ggtree")
shell: Rscript {0}

- name: Session information
Expand All @@ -87,17 +83,9 @@ jobs:
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true

- name: Show testthat output
if: always()
Expand All @@ -106,5 +94,20 @@ jobs:

- name: Test coverage
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: covr::codecov()
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
if: runner.os == 'Linux' && matrix.config.r == 'release'
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
55 changes: 30 additions & 25 deletions .github/workflows/R-CMD-check-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,40 @@ jobs:
CI: true

steps:
# configure git to prevent it from automatically converting line-endings
# this is important to avoid WARNINGS during CRAN checks
# that are false-positives, see:
# https://msmith.de/2020/03/12/r-cmd-check-github-actions.html
- name: Configure git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
cran/XML
any::remotes
any::rcmdcheck
gurobi=?ignore
Rsymphony=?ignore
lpsymphony=?ignore
ggtree=?ignore
- name: Install dependencies
- name: Install additional packages
run: |
options("install.packages.compile.from.source" = "never", pkgType = "binary")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
options(repos = "https://cloud.r-project.org/")
remotes::install_cran("Rsymphony")
remotes::install_bioc("lpsymphony")
remotes::install_bioc("ggtree")
shell: Rscript {0}

- name: Session information
Expand All @@ -65,19 +78,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: oppr
Type: Package
Version: 1.0.4
Version: 1.0.4.1
Title: Optimal Project Prioritization
Description: A decision support tool for prioritizing conservation projects.
Prioritizations can be developed by maximizing expected feature richness,
Expand Down Expand Up @@ -41,10 +41,11 @@ Imports:
tibble (>= 2.0.0),
ape (>= 5.2),
tidytree (>= 0.3.3),
ggplot2 (>= 3.0.0),
ggplot2 (>= 3.5.0),
viridisLite (>= 0.3.0),
lpSolveAPI (>= 5.5.2.0.17),
withr (>= 2.4.1),
rlang (>= 1.1.3)
Suggests:
testthat (>= 2.0.0),
knitr (>= 1.20),
Expand All @@ -65,11 +66,10 @@ LinkingTo:
RcppProgress (>= 0.4.1)
License: GPL-3
LazyData: true
SystemRequirements: C++11
URL: https://prioritizr.github.io/oppr/
BugReports: https://github.com/prioritizr/oppr/issues
VignetteBuilder: knitr
RoxygenNote: 7.2.1
RoxygenNote: 7.3.1
Encoding: UTF-8
Language: en-US
Collate:
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ S3method(print,ScalarParameter)
S3method(print,Solver)
export("%>%")
export("%T>%")
export()
export(ArrayParameter)
export(Collection)
export(Constraint)
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# oppr 1.0.4.1

- Fix aliasing for package manual entry (#21).
- Fix compatibility with updates to _ggplot2_ package.
- Fix compatibility with updates to package citation format.
- Fix broken URLs in package documentation.
- Fix broken badges in README.

# oppr 1.0.4

- CRAN release.
Expand Down
8 changes: 2 additions & 6 deletions R/add_gurobi_solver.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,12 @@ NULL
#'
#' To install the \pkg{gurobi} package, the
#' [Gurobi](https://www.gurobi.com) optimization suite will first need to
#' be installed (see instructions for [Linux](https://www.gurobi.com/documentation/8.1/quickstart_linux/software_installation_guid.html),
#' [Mac OSX](https://www.gurobi.com/documentation/8.1/quickstart_mac/software_installation_guid.html), and
#' [Windows](https://www.gurobi.com/documentation/8.1/quickstart_windows/software_installation_guid.html) operating systems). Although
#' be installed (see <https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer> for instructions). Although
#' [Gurobi](https://www.gurobi.com) is a commercial software, academics
#' can obtain a
#' [special license for no cost](https://www.gurobi.com/downloads/end-user-license-agreement-academic/). After installing the
#' [Gurobi](https://www.gurobi.com) optimization suite, the \pkg{gurobi}
#' package can then be installed (see instructions for [Linux](https://www.gurobi.com/documentation/8.1/quickstart_linux/r_installing_the_r_package.html),
#' [Mac OSX](https://www.gurobi.com/documentation/8.1/quickstart_mac/r_installing_the_r_package.html), and
#' [Windows](https://www.gurobi.com/documentation/8.1/quickstart_windows/r_installing_the_r_package.html) operating systems).
#' package can then be installed (see <https://www.gurobi.com/documentation/current/refman/r_ins_the_r_package.html> for instructions).
#'
#' @return [ProjectProblem-class] object with the solver added
#' to it.
Expand Down
2 changes: 1 addition & 1 deletion R/add_lpsolveapi_solver.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NULL
#'
#' @inheritParams add_gurobi_solver
#'
#' @details [*lp_solve*](http://lpsolve.sourceforge.net/5.5/) is an
#' @details [*lp_solve*](https://lpsolve.sourceforge.net/5.5/) is an
#' open-source integer programming solver.
#' Although this solver is the slowest currently supported solver,
#' it is also the only exact algorithm solver that can be installed on all
Expand Down
15 changes: 6 additions & 9 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,17 @@ NULL
#' If the installation process fails, please consult the
#' [package's online documentation](https://bioconductor.org/packages/release/bioc/html/ggtree.html). To install the \pkg{gurobi} package, the
#' [Gurobi](https://www.gurobi.com) optimization suite will first need to
#' be installed (see instructions for [Linux](https://www.gurobi.com/documentation/8.1/quickstart_linux/software_installation_guid.html),
#' [Mac OSX](https://www.gurobi.com/documentation/8.1/quickstart_mac/software_installation_guid.html), and
#' [Windows](https://www.gurobi.com/documentation/8.1/quickstart_windows/software_installation_guid.html) operating systems). Although
#' be installed (see <https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer> for instructions). Although
#' [Gurobi](https://www.gurobi.com) is a commercial software, academics
#' can obtain a
#' [special license for no cost](https://www.gurobi.com/downloads/end-user-license-agreement-academic/). After installing the
#' [Gurobi](https://www.gurobi.com) optimization suite, the \pkg{gurobi}
#' package can then be installed (see instructions for [Linux](https://www.gurobi.com/documentation/8.1/quickstart_linux/r_installing_the_r_package.html),
#' [Mac OSX](https://www.gurobi.com/documentation/8.1/quickstart_mac/r_installing_the_r_package.html), and
#' [Windows](https://www.gurobi.com/documentation/8.1/quickstart_windows/r_installing_the_r_package.html) operating systems).
#' package can then be installed (see <https://www.gurobi.com/documentation/current/refman/r_ins_the_r_package.html> for instructions).
#'
#' @seealso Please refer to the package vignette for more information and worked
#' examples. This can be accessed using the code
#' `vignette("oppr")`.
#'
#' @name oppr
#'
#' @examples
#' # load data
#' data(sim_projects, sim_features, sim_actions)
Expand Down Expand Up @@ -94,5 +88,8 @@ NULL
#' # visualize solution
#' plot(p, s)
#' }
#'
#' @name oppr
#' @docType package
NULL
#' @aliases oppr-package
"_PACKAGE"
Loading

0 comments on commit dbe2eca

Please sign in to comment.