-
Notifications
You must be signed in to change notification settings - Fork 13
/
dev_history.R
161 lines (133 loc) · 5.35 KB
/
dev_history.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
usethis::use_build_ignore("devstuff_history.R")
usethis::use_build_ignore("dev/")
usethis::use_build_ignore("cran-comments.md")
usethis::use_git_ignore("cran-comments.md")
usethis::use_readme_rmd()
usethis::use_git()
usethis::use_travis()
usethis::use_news_md()
usethis::use_pkgdown()
# contributing
usethis::use_tidy_contributing()
usethis::use_build_ignore("CONTRIBUTING.md")
usethis::use_code_of_conduct(contact = "sebastien@thinkr.fr")
library(desc)
library(glue)
fill_desc_generic <- function(
name, Title,
Description = "Here.",
repo = name,
dev = c("person('Vincent', 'Guyader', email = 'vincent@thinkr.fr', role = c('cre', 'aut'))",
"person('Sébastien', 'Rochette', email = 'sebastien@thinkr.fr', role = c('aut'))"),
github_user = "Thinkr-open",
version = "0.0.0.9000")
{
unlink("DESCRIPTION")
my_desc <- desc::description$new("!new")
my_desc$set("Package", name)
my_desc$set("Authors@R", glue("c(", glue_collapse(dev, sep = ",\n\t\t"), ")"))
my_desc$del("Maintainer")
my_desc$set_version(version)
my_desc$set(Title = Title)
my_desc$set(Description = paste(Description))
my_desc$set("URL", glue("https://github.com/{github_user}/{repo}"))
my_desc$set("BugReports", glue("https://github.com/{github_user}/{repo}/issues"))
my_desc$write(file = "DESCRIPTION")
}
fill_desc_generic(
name = "attachment",
Description = c(
"This package contains tools to help manage dependencies during package",
"development. This can retrieve all dependencies that are used in R files",
"in the \"R\" directory, in Rmd files in \"vignettes\" directory and in roxygen2",
"documentation of functions. There is a function to update the Description file",
"of your package and a function to create a file with the R commands to install",
"all dependencies of your package. All functions to retrieve dependencies of R",
"scripts and Rmd files can be used independently of a package development."),
Title = "Deal with dependencies")
usethis::use_pipe()
# usethis::use_package("stringr")
# usethis::use_package("magrittr")
options(usethis.full_name = "Vincent Guyader")
usethis::use_gpl3_license()
usethis::use_tidy_description()
usethis::use_test("attachment")
usethis::use_test("att_from_namespace")
usethis::use_test("att_to_desc_from_is")
usethis::use_coverage()
usethis::use_appveyor()
usethis::use_github_action_check_standard()
usethis::use_github_action("pkgdown")
usethis::use_github_action("test-coverage")
usethis::use_github_action(url = "https://github.com/DavisVaughan/extrachecks-html5/blob/main/R-CMD-check-HTML5.yaml")
usethis::use_vignette("use_renv")
usethis::use_build_ignore("_pkgdown.yml")
pkgdown::build_site()
# PR ----
usethis::pr_fetch(28)
usethis::pr_push()
# Deprecation
# usethis::
# Document ----
# Do not parse dir.t because of tests
attachment::att_from_rscripts("tests")
usethis::use_roxygen_md()
roxygen2md::roxygen2md()
roxygen2::roxygenise()
attachment::att_amend_desc(
pkg_ignore = c("remotes", "i", "usethis", "rstudioapi", "renv",
"gitlab", "git", "local", "find.rscript", "bioc",
"find.me", "findme1", "findme2", "findme3", "findme4",
"findme5", "findme6", "findme1a", "findme2a", "findme3a",
"findme4a", "findme5a", "findme6a", "ggplot3",
"svn", "pkgload", "bookdown"), #i
extra.suggests = c("testthat", "rstudioapi", "renv", "lifecycle"), #"pkgdown", "covr",
normalize = FALSE,
must.exist = TRUE,
update.config = TRUE)
attachment::create_dependencies_file(field = c("Depends", "Imports", "Suggests"))
attachment::dependencies_file_text(field = c("Depends", "Imports", "Suggests"))
usethis::use_vignette("fill-pkg-description")
# Checks
# remotes::install_github("r-lib/devtools")
devtools::build_vignettes()
devtools::check()
# Check for remotes ----
packageDescription("glue")[["Repository"]]
remotes::install_github("tidyverse/glue")
# restart session
rstudioapi::restartSession()
devtools::test()
# install back from CRAN
install.packages("glue")
# restart session
rstudioapi::restartSession()
devtools::test()
# Test specific interactive ----
devtools::load_all()
withr::with_envvar(list("NOT_CRAN" = "true"), {
testthat::test_file(here::here("tests/testthat/test-amend-description.R"))
testthat::test_file(here::here("tests/testthat/test-renv_create.R"))
})
# Test for dependencies
tools:::.check_packages_used_in_tests(dir = ".", testdir = "tests/testthat")
# Checks for CRAN release ----
## Copy the latest version of PREPARE_FOR_CRAN ----
url <- "https://raw.githubusercontent.com/ThinkR-open/prepare-for-cran/master/README.md"
destination <- "dev/dev_history_PREPARE_FOR_CRAN.md"
download.file(url, destfile = destination, mode = "wb")
line <- grep(pattern = "# Prepare for CRAN ----", readLines(destination))
rstudioapi::navigateToFile(destination, line = line)
### Run the automated tests
## {attachment} specificity : ----
### An alias for `att_to_description` -> ok
### If `Check reverse dependencies` doesn't work`with `revdep_check()`:
### retrieve the GitHub files of the {attachment}-dependent packages (checkhelper, fusen and golem),
### install attachment locally and check().
## BEFORE RELEASE: ----
### Add comments for CRAN
### Need to .gitignore this file
usethis::use_cran_comments(open = rlang::is_interactive())
### Why we have `\dontrun{}`
usethis::use_git_ignore("cran-comments.md")
usethis::use_git_ignore("CRAN-SUBMISSION")