Skip to content

Commit

Permalink
No DOI on base packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Aug 9, 2024
1 parent f158196 commit 6164006
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
9 changes: 8 additions & 1 deletion R/utils-create.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ get_dependencies <- function(desc_path,
mod$abstract <- mod$title
mod$title <- n$package
# If on CRAN add CRAN DOI
if (!is.null(n$package)) {
# Base packs
base_pkgs <- rownames(installed.packages(priority = "base"))

cran_doi <- all(
n$package %in% avail_on_init$Package,
!n$package %in% base_pkgs
)
if (cran_doi) {
mod$doi <- paste0("10.32614/CRAN.package.", n$package)
}
}
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ test <- cff_create("rmarkdown")
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2024'
doi: 10.32614/CRAN.package.methods
- type: software
title: tinytex
abstract: 'tinytex: Helper Functions to Install and Maintain TeX Live, and Compile
Expand All @@ -446,7 +445,6 @@ test <- cff_create("rmarkdown")
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2024'
doi: 10.32614/CRAN.package.tools
- type: software
title: utils
abstract: 'R: A Language and Environment for Statistical Computing'
Expand All @@ -457,7 +455,6 @@ test <- cff_create("rmarkdown")
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2024'
doi: 10.32614/CRAN.package.utils
- type: software
title: xfun
abstract: 'xfun: Supporting Functions for Packages Maintained by ''Yihui Xie'''
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
},
"isPartOf": "https://ropensci.org",
"keywords": ["attribution", "citation", "credit", "citation-files", "cff", "metadata", "r", "r-package", "citation-file-format", "rstats", "ropensci", "cran"],
"fileSize": "1623.723KB",
"fileSize": "1624.56KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
6 changes: 1 addition & 5 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ CRC
Cabunoc
Chue
CodeMeta
DOI
Decoret
Druskat
Easi
Expand Down Expand Up @@ -46,15 +45,13 @@ Pérez
README
RSPM
RStudio
Reproducibility
Riederer
SPDX
Spaaks
Suárez
Waldir
Wickham
Willighagen
YAML
Zenodo
Zotero
al
Expand All @@ -78,13 +75,12 @@ inproceedings
json
jsonvalidate
nd
orcid
pak
param
plaintext
pre
rOpenSci
repo
repos
rmarkdown
schemas
testthat
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-cff_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ test_that("Coerce keywords from GH", {

cffobj1 <- cff_create(tmp)
expect_true(cff_validate(cffobj1, verbose = FALSE))

skip_if(is.null(cffobj1$keywords), "keywords not gathered")

expect_false(is.null(cffobj1$keywords))

# Concatenate keywords of both sources
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-cff_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ test_that("cff_read DESCRIPTION", {
fno <- cff_read_description(f, gh_keywords = FALSE)
f2 <- cff_read_description(f, gh_keywords = TRUE)

# In some instances keywords are not retrieved
skip_if(is.null(f2$keywords), "keywords not gathered")


expect_false(is.null(f2$keywords))
expect_gt(length(f2$keywords), length(fno$keywords))
})
Expand Down

0 comments on commit 6164006

Please sign in to comment.