How to satisfy both CRAN and Github license file naming requirements
roxygen cheat sheet
r difference between library() and require
r function comment header
r package examples
r export function from package
r package naming conventions
package not found in loaded packages or namespaces
(NOTE: This question includes the word "license". But let's be clear: this question is not asking for licensing advice. It is asking how to simultaneously satisfy the file naming requirements of "software tools commonly used by programmers": Github and CRAN. This question could just as easily be about README files. The mere use of the word "license" seems to make folks trigger happy with their close votes.)
I have an R package who's code I'd like to keep on Github.
License: MIT + file LICENCE
LICENCE file contains the MIT template, as required:
YEAR: 2017 COPYRIGHT HOLDER: Don Quixote
Github used to figure out licensing only by looking at the
LICENSE file, which allowed me to keep the MIT text in
LICENSE so that Github would detect it and the CRAN template in
LICENCE so that CRAN would detect it. This approach used
.Rbuildignore to hide the Github
LICENSE from CRAN.
But now, a darkness has fallen on the land: Github looks at both
LICENCE. Finding them different, it abandons its attempt to determine the project's license.
As a result, it does not seem possible to use the MIT license, or other templated licenses, in a way which satisfies both CRAN and Github.
Renaming my CRAN license template file from
LICENCE.template would fix the issue, but then CRAN complains about a non-standard file.
I could omit a the CRAN license template file from the git repo, but then I'm not sacrificing version control for expediency.
Is there a workaround?
[R] CRAN and Github: Licensing Issues, In accordance with R's requirements (see here for a note about template licenses), I have in my Renaming my CRAN license template file from `LICENCE` to possible to use the MIT license in a way which satisfies both CRAN and Github. (I feel CRAN is at fault here by using a standardized file name To have your license detected, simplify your LICENSE file and note the complexity somewhere else, such as your repository's README file. Applying a license to a repository with an existing license The license picker is only available when you create a new project on GitHub.
There was an extended discussion on this topic in the tidyr issues (Hadley Wickham participated, which adds a little extra credibility). The solution was to use the two-line CRAN template as
LICENSE (for CRAN) and then the full MIT license in
LICENSE.md and add that to
.Rbuildignore (for GitHub). See the relevant pull for tidyr.
This is a similar solution to the current top answer, but it feels cleaner to me as it does not use a spelling-based "hack".
Fails for CRAN package with MIT license · Issue #185 , The specification for creating a CRAN project with the MIT license requires putting the following line in the DESCRIPTION file: License: MIT + file LICENSE and creating a LICENSE file that contains both return the following result: the strict and inflexible requirements at CRAN to use a file that must be called "LICENSE" In the file name field, type LICENSE or LICENSE.md (with all caps). To the right of the file name field, click Choose a license template . On the left side of the page, under "Add a license to your project," review the available licenses, then select a license from the list.
You can now follow the submission templates for CRAN and it will be supported by GitHub. For instance, this repository uses a CRAN License template and correctly shows the License on GitHub: https://github.com/TomKellyGenetics/vioplot
This is compatible with a CRAN submission. CRAN will reject a submission with the full license file rather than the template:
License components with restrictions and base license permitting such: BSD_3_clause + file LICENSE File 'LICENSE': Copyright (c) 2004, Daniel Adler All rights reserved.
Please only ship the CRAN template for the BSD_3_clause license.
This is supported by GitHub (which may have been updated). You must submit to CRAN with
License: BSD_3_clause + file LICENSE (or MIT) and use only a template file such as:
YEAR: 2004 COPYRIGHT HOLDER: Daniel Adler ORGANIZATION: University of Goettingen
Package basics · R packages, The job of the DESCRIPTION file is to store important metadata about your package. package does (one paragraph) Depends: R (>= 3.1.0) License: What license is Both Imports and Suggests take a comma separated list of package names. Suggests : your package can use these packages, but doesn't require them. Tom Kelly. Postdoctoral Reseacher 2 How to select a CRAN mirror in R Feb 20 '18. May 10 '19. 1 How to satisfy both CRAN and Github license file naming
Checking a package · R packages, If you use GitHub, you'll learn precisely how to do that with Travis-CI. Workflow. R CMD check is the name of the command you run from the terminal. Checking for file 'httr/DESCRIPTION'; This is package 'httr' version '0.5.0.9000' You can not use a custom license as CRAN does not have the legal resources to review Under Section 7 of AGPL-3.0, you are granted additional permissions described in the REMIND License Exception, version 1.0 (see LICENSE file). NOTES Following the principles of good scientific practice it is recommended to make the source code available in the events of model based publications or model-based consulting.
git2rdata git2rdata logo, By default, git2rdata optimizes the data for file storage. reduces the required disk space by about 30% for both the working directory and the git history. The file is named rule-name.json, where rule-name is typically the name of the system dependency. For example, here's an excerpt from a rule for the Protocol Buffers (protobuf) library at rules/libprotobuf.json .
[PDF] Package 'usethis', coverage, continuous integration, Git, 'GitHub', licenses, 'Rcpp', 'RStudio' projects, and more. URL https://usethis.r-lib.org, https://github.com/r-lib/usethis If FALSE and a non-package project, a sentinel .here file is placed Whether to check if the name is valid for CRAN and throw an error if not open. :exclamation: This is a read-only mirror of the CRAN R package repository. tabulog — Parsing Semi-Structured Log Files into Tabular Format - cran/tabulog
- You can include a license file that is listed in your .Rbuildignore file and thus present on Github but also CRAN-compliant.
- @Thomas: It's a good point! I am using
.Rbuildignoreto achieve CRAN compliance, but I'm loathe to use
.gitignorein the same way: it's nice to have everything version controlled. But it may be necessary.
- What about putting the entire MIT license text in your LICENSE file? Then your DESCRIPTION could read 'License: file LICENSE'. It would allow Github to get things right, and it meets the requirements of R 'One of the strings ‘file LICENSE’ or ‘file LICENCE’ referring to a file named LICENSE or LICENCE in the package (source and installation) top-level directory.' I'm just not certain if CRAN would accept using a 'standard' license in that way, rather than 'MIT + file LICENSE'.
- That has a "view license button" but not a "hey look i'm MIT license" button as the asker probably intended
- That's correct: this does not allow Github to automatically detect the type of the license.