Skip to content

Commit

Permalink
Merge pull request #80 from ropensci/fixcran
Browse files Browse the repository at this point in the history
Adapt to changes in person (R 4.5.0)
  • Loading branch information
dieghernan committed Aug 9, 2024
2 parents eb85704 + 3f70834 commit f158196
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
5 changes: 1 addition & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "cffr" in publications use:'
type: software
license: GPL-3.0-or-later
title: 'cffr: Generate Citation File Format (''cff'') Metadata for R Packages'
version: 1.1.0
version: 1.1.0.9000
doi: 10.21105/joss.03900
identifiers:
- type: doi
Expand Down Expand Up @@ -143,9 +143,6 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
doi: 10.32614/CRAN.package.jsonlite
version: '>= 1.7.2'
- type: software
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cffr
Title: Generate Citation File Format ('cff') Metadata for R Packages
Version: 1.1.0
Version: 1.1.0.9000
Authors@R: c(
person("Diego", "Hernangómez", , "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0001-8457-4658")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# cffr (development version)

- Adapt extraction of orcid to **R \> 4.4.1**.

# cffr 1.1.0

- Now **cffr** adds automatically dois to packages on **CRAN** (e.g.
Expand Down
12 changes: 10 additions & 2 deletions R/as_cff_person.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ as_cff_person <- function(x, ...) {
#' @rdname as_cff_person
#' @order 2
as_cff_person.default <- function(x, ...) {
x <- clean_str(x)
# Check if this is protected
if (!inherits(x, "Bibtex")) x <- clean_str(x)
if (is.null(x)) {
return(NULL)
}
Expand All @@ -197,7 +198,14 @@ as_cff_person.person <- function(x, ...) {
#' @rdname as_cff_person
#' @order 4
as_cff_person.character <- function(x, ...) {
test_x <- clean_str(x)
# Maybe is protected ...
if (any(grepl("{", x, fixed = TRUE))) {
test_x <- x
} else {
test_x <- clean_str(x)
}


if (is.null(test_x)) {
return(NULL)
}
Expand Down
5 changes: 5 additions & 0 deletions R/utils-persons.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ extract_person_comments <- function(person) {
# guess orcid
orcid <- url_comment[grepl("orcid.org/", url_comment)]

# Case for R > 4.4.1
if ("orcid" %in% names(comm_cff)) {
orcid <- clean_str(comm_cff$orcid)
}

# Get the first non-orcid url
web <- url_comment[!grepl("orcid.org/", url_comment)][1]

Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ knitr::include_graphics("vignettes/tweet-1.png")
*--- Nat Friedman (\@natfriedman) July 27, 2021*

See [Enhanced support for citations on
GitHub](https://github.blog/2021-08-19-enhanced-support-citations-github/)
GitHub](https://github.blog/news-insights/company-news/enhanced-support-citations-github/)
[@smith2021] for more info.

### Related projects
Expand Down
82 changes: 6 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interest:
*— Nat Friedman (@natfriedman) July 27, 2021*

See [Enhanced support for citations on
GitHub](https://github.blog/2021-08-19-enhanced-support-citations-github/)
GitHub](https://github.blog/news-insights/company-news/enhanced-support-citations-github/)
([Smith 2021](#ref-smith2021)) for more info.

### Related projects
Expand All @@ -73,7 +73,7 @@ file and the `CITATION` file (if present) of your package. Note that
**cffr** works best if your package pass
`R CMD check/devtools::check()`.

As per 2024-07-23 there are at least 290 repos on GitHub using **cffr**.
As per 2024-08-09 there are at least 290 repos on GitHub using **cffr**.
[Check them out
here](https://github.com/search?q=cffr%20path%3A**%2FCITATION.cff&type=code).

Expand Down Expand Up @@ -229,6 +229,7 @@ test <- cff_create("rmarkdown")
url: https://github.com/rstudio/rmarkdown
repository: https://CRAN.R-project.org/package=rmarkdown
repository-code: https://github.com/rstudio/rmarkdown
commit: '2.27'
url: https://pkgs.rstudio.com/rmarkdown/
date-released: '2024-05-17'
contact:
Expand Down Expand Up @@ -394,9 +395,6 @@ test <- cff_create("rmarkdown")
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
doi: 10.32614/CRAN.package.jsonlite
- type: software
title: knitr
Expand Down Expand Up @@ -572,27 +570,6 @@ test <- cff_create("rmarkdown")
given-names: Michael
year: '2024'
doi: 10.32614/CRAN.package.digest
- type: software
title: dygraphs
abstract: 'dygraphs: Interface to ''Dygraphs'' Interactive Time Series Charting
Library'
notes: Suggests
url: https://github.com/rstudio/dygraphs
repository: https://CRAN.R-project.org/package=dygraphs
authors:
- family-names: Vanderkam
given-names: Dan
website: http://dygraphs.com/
- family-names: Allaire
given-names: JJ
- family-names: Owen
given-names: Jonathan
- family-names: Gromer
given-names: Daniel
- family-names: Thieurmel
given-names: Benoit
year: '2024'
doi: 10.32614/CRAN.package.dygraphs
- type: software
title: fs
abstract: 'fs: Cross-Platform File System Operations Based on ''libuv'''
Expand All @@ -610,27 +587,6 @@ test <- cff_create("rmarkdown")
email: [email protected]
year: '2024'
doi: 10.32614/CRAN.package.fs
- type: software
title: rsconnect
abstract: 'rsconnect: Deploy Docs, Apps, and APIs to ''Posit Connect'', ''shinyapps.io'',
and ''RPubs'''
notes: Suggests
url: https://rstudio.github.io/rsconnect/
repository: https://CRAN.R-project.org/package=rsconnect
authors:
- family-names: Atkins
given-names: Aron
email: [email protected]
- family-names: Allen
given-names: Toph
- family-names: Wickham
given-names: Hadley
- family-names: McPherson
given-names: Jonathan
- family-names: Allaire
given-names: JJ
year: '2024'
doi: 10.32614/CRAN.package.rsconnect
- type: software
title: downlit
abstract: 'downlit: Syntax Highlighting and Automatic Linking'
Expand All @@ -644,20 +600,6 @@ test <- cff_create("rmarkdown")
year: '2024'
doi: 10.32614/CRAN.package.downlit
version: '>= 0.4.0'
- type: software
title: katex
abstract: 'katex: Rendering Math to HTML, ''MathML'', or R-Documentation Format'
notes: Suggests
url: https://docs.ropensci.org/katex/
repository: https://CRAN.R-project.org/package=katex
authors:
- family-names: Ooms
given-names: Jeroen
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
doi: 10.32614/CRAN.package.katex
version: '>= 1.4.0'
- type: software
title: sass
abstract: 'sass: Syntactically Awesome Style Sheets (''Sass'')'
Expand Down Expand Up @@ -773,19 +715,6 @@ test <- cff_create("rmarkdown")
email: [email protected]
year: '2024'
doi: 10.32614/CRAN.package.vctrs
- type: software
title: cleanrmd
abstract: 'cleanrmd: Clean Class-Less ''R Markdown'' HTML Documents'
notes: Suggests
url: https://pkg.garrickadenbuie.com/cleanrmd/
repository: https://CRAN.R-project.org/package=cleanrmd
authors:
- family-names: Aden-Buie
given-names: Garrick
email: [email protected]
orcid: https://orcid.org/0000-0002-7111-0077
year: '2024'
doi: 10.32614/CRAN.package.cleanrmd
- type: software
title: withr
abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
Expand Down Expand Up @@ -937,7 +866,8 @@ for more info.

## References

<div id="refs" class="references csl-bib-body hanging-indent">
<div id="refs" class="references csl-bib-body hanging-indent"
entry-spacing="0">

<div id="ref-codemeta" class="csl-entry">

Expand Down Expand Up @@ -1006,7 +936,7 @@ Exchange Schema for Software Metadata*. KNB Data Repository.
<div id="ref-smith2021" class="csl-entry">

Smith, Arfon. 2021. “Enhanced Support for Citations on GitHub.”
<https://github.blog/2021-08-19-enhanced-support-citations-github/>.
<https://github.blog/news-insights/company-news/enhanced-support-citations-github/>.

</div>

Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"codeRepository": "https://github.com/ropensci/cffr",
"issueTracker": "https://github.com/ropensci/cffr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "1.1.0",
"version": "1.1.0.9000",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"runtimePlatform": "R Under development (unstable) (2024-08-07 r86984 ucrt)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down 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": "1604.704KB",
"fileSize": "1623.723KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
Binary file modified data/cran_to_spdx.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/REFERENCES.bib
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ @misc{smith2021
author = {Smith, Arfon},
year = 2021,
month = aug,
url = {https://github.blog/2021-08-19-enhanced-support-citations-github/}
url = {https://github.blog/news-insights/company-news/enhanced-support-citations-github/}
}
@book{van-leunen,
title = {A handbook for scholars},
Expand Down
4 changes: 2 additions & 2 deletions inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"version": "1.1.0"
"runtimePlatform": "R Under development (unstable) (2024-08-07 r86984 ucrt)",
"version": "1.1.0.9000"
}
12 changes: 7 additions & 5 deletions man/cff_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
|collate |C.UTF-8 |
|ctype |C.UTF-8 |
|tz |UTC |
|date |2024-08-08 |
|date |2024-08-09 |
|pandoc |3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/pandoc |

# Dependencies

|package |old |new |Δ |
|:------------|:------|:------|:--|
|cffr |1.1.0 |1.1.0 |NA |
|cli |3.6.3 |3.6.3 |NA |
|curl |5.2.1 |5.2.1 |NA |
|desc |1.4.3 |1.4.3 |NA |
|jsonlite |1.8.8 |1.8.8 |NA |
|jsonvalidate |1.3.2 |1.3.2 |NA |
|R6 |2.5.1 |2.5.1 |NA |
|Rcpp |1.0.13 |1.0.13 |NA |
|V8 |4.4.2 |4.4.2 |NA |
|yaml |2.3.10 |2.3.10 |NA |
|package |old |new |Δ |
|:------------|:------|:----------|:--|
|cffr |1.1.0 |1.1.0.9000 |* |
|cli |3.6.3 |3.6.3 | |
|curl |5.2.1 |5.2.1 | |
|desc |1.4.3 |1.4.3 | |
|jsonlite |1.8.8 |1.8.8 | |
|jsonvalidate |1.3.2 |1.3.2 | |
|R6 |2.5.1 |2.5.1 | |
|Rcpp |1.0.13 |1.0.13 | |
|V8 |4.4.2 |4.4.2 | |
|yaml |2.3.10 |2.3.10 | |

# Revdeps

2 changes: 0 additions & 2 deletions tests/testthat/_snaps/cff_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,11 @@
- family-names: Boettiger
given-names: Carl
email: [email protected]
orcid: https://orcid.org/0000-0002-1642-628X
url: https://httpbin.org/status/404
contact:
- family-names: Boettiger
given-names: Carl
email: [email protected]
orcid: https://orcid.org/0000-0002-1642-628X
keywords:
- metadata
- codemeta
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1109,19 +1109,19 @@
Code
toBibtex(sev_auth)
Output
[1] "{The Big Bopper} and Sinatra, Frank and Martin, Dean and Davis, Jr., Sammy"
{The Big Bopper} and Sinatra, Frank and Martin, Dean and Davis, Jr., Sammy

---

Code
toBibtex(single)
Output
[1] "person, A"
person, A

---

Code
toBibtex(single)
Output
[1] "{A and B co}"
{A and B co}

Loading

0 comments on commit f158196

Please sign in to comment.