Jim Hester
2020-Apr-15 14:20 UTC
[Rd] Add a new environment variable switch for the 'large version' check
If you test a package with `R CMD check --as-cran` one of the 'incoming' checks is for a large version number, it gives a NOTE like this * checking CRAN incoming feasibility ... NOTE Maintainer: ?Jim Hester <james.f.hester at gmail.com>? Version contains large components (0.0.0.9000) This is a useful check when packages are submitted to CRAN because it catches these large version components, which typically are reserved for development versions of packages. However when checking packages during development it is often expected to have these large versions, so this note can be confusing for those new to package development. Currently the only way to turn off this particular check is to turn off _all_ of the CRAN incoming checks. The following patch (also attached) adds an environment variable that can be used to disable just this check, which would allow users to disable it if they expect to be using a large version. The default behavior (and CRAN's usage) would remain unchanged. diff --git a/src/library/tools/R/QC.R b/src/library/tools/R/QC.R index 062722127a..64acd72c5e 100644 --- a/src/library/tools/R/QC.R +++ b/src/library/tools/R/QC.R @@ -6963,7 +6963,9 @@ function(dir, localOnly = FALSE) if(grepl("(^|[.-])0[0-9]+", ver)) out$version_with_leading_zeroes <- ver unlisted_version <- unlist(package_version(ver)) - if(any(unlisted_version >= 1234 & unlisted_version !as.integer(format(Sys.Date(), "%Y")))) + if(any(unlisted_version >= 1234 & unlisted_version !as.integer(format(Sys.Date(), "%Y"))) && + !config_val_to_logical(Sys.getenv("_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_", + "FALSE"))) out$version_with_large_components <- ver .aspell_package_description_for_CRAN <- function(dir, meta = NULL) {
Dirk Eddelbuettel
2020-Apr-16 14:44 UTC
[Rd] Add a new environment variable switch for the 'large version' check
Or you use a fourth component to signal a development version as Rcpp has done for years (and, IIRC, for longer than devtools et al used '9000'). There is no functional difference between 1.2.3.1 and 1.2.3.9000. They are both larger than 1.2.3 (in the package_version() sense) and signal an intermediate version between 1.2.3 and 1.2.4. But one requires a patch. ?\_(?)_/?. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Henrik Bengtsson
2020-Apr-16 16:06 UTC
[Rd] Add a new environment variable switch for the 'large version' check
I'd second Jim's feature request - it would be useful to be able to disable this in CI and elsewhere. The concept of using an "unusual" version component such as a very large number does a nice job of indicating "unusual" and serves as a blocker for submitting work-in-progress to CRAN by mistake (hence the validation in 'R CMD check'). Another point, which I don't think Jim made, is that this would make it possible to run R CMD check --as-cran on your work-in-progress and get all OKs. This in turn would allow us to trigger a non-zero exit status also for NOTEs (not just ERRORs and WARNINGs). Currently, the warning on -9000 is a false positive in this sense. This will allow developers to be more conservative without risking to treat NOTEs as something to expect as normal. CI services are typically configured to alert the developer on ERRORs and WARNINGs but, AFAIK, not on NOTEs. On the topic of unusual version numbers: I'd like to suggest that CRAN(*) makes an unusual version bump whenever they orphan a package, e.g. to suffix -00001. CRAN already updates/modifies the package tarball for orphaned packages by setting 'Maintainer: ORPHANED' in the DESCRIPTION file. By also bumping the version of orphaned packages it would it stand out in sessionInfo(), which helps in troubleshooting and bug reports, etc. But more importantly, the most recent stable CRAN release remain untouched, which I think has a value by itself for scientific purposes. /Henrik (*) Yes, I should email CRAN about this, but I think it's worth vetting it here first. On Thu, Apr 16, 2020 at 7:44 AM Dirk Eddelbuettel <edd at debian.org> wrote:> > > Or you use a fourth component to signal a development version as Rcpp has > done for years (and, IIRC, for longer than devtools et al used '9000'). > > There is no functional difference between 1.2.3.1 and 1.2.3.9000. They are > both larger than 1.2.3 (in the package_version() sense) and signal an > intermediate version between 1.2.3 and 1.2.4. > > But one requires a patch. ?\_(?)_/?. > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel