@@ -102,6 +102,7 @@ attachment::dependencies_file_text(field = c("Depends", "Imports", "Suggests"))
102
102
usethis :: use_vignette(" fill-pkg-description" )
103
103
104
104
# Checks
105
+ # remotes::install_github("r-lib/devtools")
105
106
devtools :: build_vignettes()
106
107
devtools :: check()
107
108
@@ -129,119 +130,32 @@ tools:::.check_packages_used_in_tests(dir = ".", testdir = "tests/testthat")
129
130
130
131
# Checks for CRAN release ----
131
132
132
- # # Prepare for CRAN ----
133
+ # # Copy the latest version of PREPARE_FOR_CRAN ----
133
134
134
- # Check package coverage
135
- covr :: package_coverage()
136
- covr :: report( )
135
+ url <- " https://raw.githubusercontent.com/ThinkR-open/prepare-for-cran/master/README.md "
136
+ destination <- " dev/dev_history_PREPARE_FOR_CRAN.md "
137
+ download.file( url , destfile = destination , mode = " wb " )
137
138
138
- # _Check in interactive test-inflate for templates and Addins
139
- pkgload :: load_all()
140
- devtools :: test()
141
- testthat :: test_dir(" tests/testthat/" )
142
-
143
- # Test no output generated in the user files
144
- # Run examples in interactive mode too
145
- devtools :: run_examples()
146
-
147
- # Check package as CRAN
148
- rcmdcheck :: rcmdcheck(args = c(" --no-manual" , " --as-cran" ))
149
- # devtools::check(args = c("--no-manual", "--as-cran"))
150
-
151
- # Check content
152
- # install.packages('checkhelper', repos = 'https://thinkr-open.r-universe.dev')
153
- tags <-
154
- checkhelper :: find_missing_tags() # Toutes les fonctions doivent avoir soit `@noRd` soit un `@export`, (alias pour att_to_description ok)
155
- tags
156
-
157
- # _Check that you let the house clean after the check, examples and tests
158
- all_files <- checkhelper :: check_clean_userspace() # ok si ce qui reste c'est dans tmpdir()
159
- all_files
160
-
161
-
162
- # Check spelling
163
- # usethis::use_spell_check()
164
- spelling :: spell_check_package() # juste regarder s'il y a des typos
165
-
166
- # Check URL are correct - No redirection
167
- # install.packages('urlchecker', repos = 'https://r-lib.r-universe.dev')
168
- urlchecker :: url_check()
169
- urlchecker :: url_update() # corrige les redirections
170
-
171
-
172
- # Check as cran:
173
- # probleme rencontre: cf https://github.com/ThinkR-open/checkhelper/issues/79
174
- withr :: with_options(list (repos = c(CRAN = " https://cran.rstudio.com" )),
175
- {callr :: default_repos()
176
- checkhelper :: check_as_cran() })
177
- checkhelper :: check_as_cran()
178
-
179
-
180
-
181
-
182
- # check on other distributions
183
- # _rhub
184
- # devtools::check_rhub()
185
- buildpath <- devtools :: build()
186
- rhub :: platforms()
187
- rhub :: check_on_windows(check_args = " --force-multiarch" ,
188
- show_status = FALSE ,
189
- path = buildpath )
190
- rhub :: check_on_solaris(show_status = FALSE , path = buildpath )
191
- rhub :: check(platform = " debian-clang-devel" ,
192
- show_status = FALSE ,
193
- path = buildpath )
194
- rhub :: check(platform = " debian-gcc-devel" ,
195
- show_status = FALSE ,
196
- path = buildpath )
197
- rhub :: check(platform = " fedora-clang-devel" ,
198
- show_status = FALSE ,
199
- path = buildpath )
200
- rhub :: check(platform = " macos-highsierra-release-cran" ,
201
- show_status = FALSE ,
202
- path = buildpath )
203
- rhub :: check_for_cran(show_status = FALSE , path = buildpath )
204
- # _win devel
205
- devtools :: check_win_devel()
206
- devtools :: check_win_release()
207
- # remotes::install_github("r-lib/devtools")
208
- devtools :: check_mac_release() # Need to follow the URL proposed to see the results
209
-
210
-
211
- # Check reverse dependencies
212
- # https://github.com/r-lib/revdepcheck
213
- # remotes::install_github("r-lib/revdepcheck")
214
- install.packages(' revdepcheck' , repos = ' https://r-lib.r-universe.dev' )
215
- usethis :: use_git_ignore(" revdep/" )
216
- usethis :: use_build_ignore(" revdep/" )
217
-
218
- devtools :: revdep()
219
- library(revdepcheck )
220
- # In another session
221
- id <- rstudioapi :: terminalExecute(" Rscript -e 'revdepcheck::revdep_check(num_workers = 4)'" )
222
- rstudioapi :: terminalKill(id )
223
- # See outputs
224
- revdep_details(revdep = " pkg" )
225
- revdep_summary() # table of results by package
226
- revdep_report() # in revdep/
227
- # Clean up when on CRAN
228
- revdep_reset()
229
-
230
- # Si cela ne fonctionne pas : recuperer les GitHub des packages dependant de attachment (fusen et golem), installer attachment en local et check()
231
-
232
- # Update NEWS
233
- # Bump version manually and add list of changes
234
-
235
- # Upgrade version number
236
- usethis :: use_version(which = c(" patch" , " minor" , " major" , " dev" )[2 ])
237
-
238
- # Add comments for CRAN
239
- # Need to .gitignore this file
139
+ line <- grep(pattern = " # Prepare for CRAN ----" , readLines(destination ))
140
+ rstudioapi :: navigateToFile(destination , line = line )
141
+
142
+ # ## Run the automated tests
143
+
144
+ # # {attachment} specificity : ----
145
+
146
+ # ## An alias for `att_to_description` -> ok
147
+
148
+ # ## If `Check reverse dependencies` doesn't work`with `revdep_check()`:
149
+ # ## retrieve the GitHub files of the {attachment}-dependent packages (checkhelper, fusen and golem),
150
+ # ## install attachment locally and check().
151
+
152
+ # # BEFORE RELEASE: ----
153
+
154
+ # ## Add comments for CRAN
155
+ # ## Need to .gitignore this file
240
156
usethis :: use_cran_comments(open = rlang :: is_interactive())
241
- # Why we have `\dontrun{}`
157
+ # ## Why we have `\dontrun{}`
242
158
243
159
usethis :: use_git_ignore(" cran-comments.md" )
244
160
usethis :: use_git_ignore(" CRAN-SUBMISSION" )
245
161
246
- # Verify you're ready for release, and release
247
- devtools :: release()
0 commit comments