r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.37k stars 755 forks source link

Invalid license file reference note #2491

Closed Tyrrx closed 1 year ago

Tyrrx commented 1 year ago

Running the devtools::check() method after trying to add the MIT license to an package using the devtools::use_mit_license() method produces an invalid license reference note during the check. I am not sure if this is a problem related to usethis or devtools and I also have no idea how to fix this as I already tried to copy and change the license files from another package.

install.packages("usethis")
install.packages("devtools")

library(devtools)
library(usethis)

usethis::use_mit_license(copyright_holder = "David Retzlaff")
devtools::check()
# ...
# checking DESCRIPTION meta-information ... NOTE
# Ungültiger Verweis auf Lizenzdatei: LICENSE

This is the entry in the DESCRIPTION file:

License: MIT + file LICENSE

I have a LICENSE and LICENSE.md file in the filesystem.

This is the whole log:

* using R version 4.2.2 (2022-10-31 ucrt)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: UTF-8
* using options '--no-manual --as-cran'
* checking for file 'lazyiter/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'lazyiter' version '1.0.0'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'lazyiter' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... NOTE
Ungültiger Verweis auf Lizenzdatei: LICENSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking examples ... OK
* checking for unstated dependencies in 'tests' ... OK
* checking tests ... [28s] OK
  Running 'testthat.R' [27s]
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 NOTE
jennybc commented 1 year ago

I can't reproduce the problem.

library(devtools)
#> Loading required package: usethis

temp_pkg <- fs::path_temp("somepackage")
withr::local_options(list(usethis.description = NULL))

create_package(temp_pkg, open = FALSE)
#> ✔ Creating '/tmp/Rtmpy00wGe/somepackage/'
#> ✔ Setting active project to '/private/tmp/Rtmpy00wGe/somepackage'
#> ✔ Creating 'R/'
#> ✔ Writing 'DESCRIPTION'
#> Package: somepackage
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#>     license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.2.3
#> ✔ Writing 'NAMESPACE'
#> ✔ Setting active project to '<no active project>'
local_project(temp_pkg)
#> ✔ Setting active project to '/private/tmp/Rtmpy00wGe/somepackage'
use_mit_license(copyright_holder = "David Retzlaff")
#> ✔ Setting License field in DESCRIPTION to 'MIT + file LICENSE'
#> ✔ Writing 'LICENSE'
#> ✔ Writing 'LICENSE.md'
#> ✔ Adding '^LICENSE\\.md$' to '.Rbuildignore'
check()
#> ══ Documenting ═════════════════════════════════════════════════════════════════
#> ℹ Updating somepackage documentation
#> ℹ Loading somepackage
#> 
#> ══ Building ════════════════════════════════════════════════════════════════════
#> Setting env vars:
#> • CFLAGS    : -Wall -pedantic
#> • CXXFLAGS  : -Wall -pedantic
#> • CXX11FLAGS: -Wall -pedantic
#> • CXX14FLAGS: -Wall -pedantic
#> • CXX17FLAGS: -Wall -pedantic
#> • CXX20FLAGS: -Wall -pedantic
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/private/tmp/Rtmpy00wGe/somepackage/DESCRIPTION’ ... OK
#> * preparing ‘somepackage’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> Removed empty directory ‘somepackage/R’
#> Removed empty directory ‘somepackage/man’
#> * building ‘somepackage_0.0.0.9000.tar.gz’
#> 
#> ══ Checking ════════════════════════════════════════════════════════════════════
#> Setting env vars:
#> • _R_CHECK_CRAN_INCOMING_REMOTE_               : FALSE
#> • _R_CHECK_CRAN_INCOMING_                      : FALSE
#> • _R_CHECK_FORCE_SUGGESTS_                     : FALSE
#> • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE
#> • NOT_CRAN                                     : true
#> ── R CMD check ─────────────────────────────────────────────────────────────────
#> * using log directory ‘/private/tmp/Rtmpy00wGe/file5ea272acb241/somepackage.Rcheck’
#> * using R version 4.2.2 (2022-10-31)
#> * using platform: x86_64-apple-darwin17.0 (64-bit)
#> * using session charset: UTF-8
#> * using options ‘--no-manual --as-cran’
#> * checking for file ‘somepackage/DESCRIPTION’ ... OK
#> * this is package ‘somepackage’ version ‘0.0.0.9000’
#> * package encoding: UTF-8
#> * checking package namespace information ... OK
#> * checking package dependencies ... OK
#> * checking if this is a source package ... OK
#> * checking if there is a namespace ... OK
#> * checking for executable files ... OK
#> * checking for hidden files and directories ... OK
#> * checking for portable file names ... OK
#> * checking for sufficient/correct file permissions ... OK
#> * checking serialization versions ... OK
#> * checking whether package ‘somepackage’ can be installed ... OK
#> * checking installed package size ... OK
#> * checking package directory ... OK
#> * checking for future file timestamps ... OK
#> * checking DESCRIPTION meta-information ... OK
#> * checking top-level files ... OK
#> * checking for left-over files ... OK
#> * checking index information ... OK
#> * checking package subdirectories ... OK
#> * checking whether the package can be loaded ... OK
#> * checking whether the package can be loaded with stated dependencies ... OK
#> * checking whether the package can be unloaded cleanly ... OK
#> * checking whether the namespace can be loaded with stated dependencies ... OK
#> * checking whether the namespace can be unloaded cleanly ... OK
#> * checking loading without being on the library search path ... OK
#> * checking examples ... NONE
#> * checking for non-standard things in the check directory ... OK
#> * checking for detritus in the temp directory ... OK
#> * DONE
#> 
#> Status: OK
#> ── R CMD check results ───────────────────────────── somepackage 0.0.0.9000 ────
#> Duration: 4.5s
#> 
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
fs::dir_ls()
#> DESCRIPTION LICENSE     LICENSE.md  NAMESPACE   R           man
readLines("LICENSE")
#> [1] "YEAR: 2023"                       "COPYRIGHT HOLDER: David Retzlaff"
readLines("DESCRIPTION")
#>  [1] "Package: somepackage"                                                                     
#>  [2] "Title: What the Package Does (One Line, Title Case)"                                      
#>  [3] "Version: 0.0.0.9000"                                                                      
#>  [4] "Authors@R: "                                                                              
#>  [5] "    person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"),"
#>  [6] "           comment = c(ORCID = \"YOUR-ORCID-ID\"))"                                       
#>  [7] "Description: What the package does (one paragraph)."                                      
#>  [8] "License: MIT + file LICENSE"                                                              
#>  [9] "Encoding: UTF-8"                                                                          
#> [10] "Roxygen: list(markdown = TRUE)"                                                           
#> [11] "RoxygenNote: 7.2.3"

Created on 2023-01-11 with reprex v2.0.2.9000

Tyrrx commented 1 year ago

I will try it on Linux. Maybe it is a windows related issue.

jennybc commented 1 year ago

I suspect the problem lies more in the package state, i.e. something about your current package, than in devtools::use_mit_license().