hsvab / odbr

Pacote que disponibiliza dados de pesquisas OD do Brasil
https://hsvab.github.io/odbr/
GNU General Public License v3.0
14 stars 2 forks source link

Do not run slow examples #29

Closed diraol closed 11 months ago

diraol commented 11 months ago

CRAN has a limit of 5 seconds to run the examples. Since we rely on downloading large files, it usually take more than 5 seconds as a default, failing the "Checking examples" check from CRAN. So, the proposed approach here is to "Skip" running these examples.

Due to the fact that we indeed have tests covering these functions, skipping this "doc examples" execution won't impact in the project coverage.

Additionally, I've also changed the DESCRIPTION description to avoid CRAN issues with "Paulo" word from São Paulo name.

diraol commented 11 months ago

Forget it.

My local tests are still failing in the examples section with a NOTE (here in the CI we are not failing because we accept NOTEs).

To be honest, I am convinced that our best course of action here is to reply to CRAN "managers" and request those notes to be properly ignored. Especially because it seems CRAN automatically fails submissions with dontrun cases [1].

AFAIK, there isn't much we can do....

rafapereirabr commented 11 months ago

Hi all. CRAN has a few rather strict policies. The processing / checking of packages should not take more that a couple minutes. This is a problem for packages that download data and simply take too long. One simple solution to this, the one I've adopted in most of my packages, is to simply not run examples and vignettes on CRAN.

If you don't want to run examples on CRAN, you can use @examplesIf. Here is how I've implemented it in the censobr package:

#' @examplesIf identical(tolower(Sys.getenv("NOT_CRAN")), "true")
#' # return data as arrow Dataset
#' df <- read_families(year = 2000,
#'                     showProgress = FALSE)
#'

We can use us e a similar approach to NOT run vignettes on CRAN with setting a default eval in knitr::opts_chunk$set (censobr example):

{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  eval = identical(tolower(Sys.getenv("NOT_CRAN")), "true"),
  out.width = "100%"
)

Provided we run all sorts of checks and tests on different OS with CMD-check on github actions, it's fine to do this,

hsvab commented 11 months ago

That was the problem and thank you all for the insights!