Skip to content

Commit

Permalink
CRAN v1.0.1 (#2)
Browse files Browse the repository at this point in the history
* Fix CRAN NOTES and prepare Release

* Add CRAN-Release file
  • Loading branch information
mrcaseb authored Nov 24, 2020
1 parent b45d0fe commit 43f2dcc
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 19 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^\.github$
^vignettes$
^\.travis\.yml$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2020-11-20.
Once it is accepted, delete this file and tag the release (commit 33c0b47).
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: personalr
Title: Automated Personal Package Setup
Version: 1.0.0
Version: 1.0.1
Authors@R:
person(given = "Sebastian",
family = "Carl",
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
export(setup_package)
export(update_core)
importFrom(magrittr,"%>%")
importFrom(withr,with_tempdir)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# personalr 1.0.1

* Preparation for CRAN

# personalr 1.0.0

* Initial release
1 change: 1 addition & 0 deletions R/personalr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# roxygen namespace tags. Modify with care!
## usethis namespace: start
#' @importFrom magrittr %>%
#' @importFrom withr with_tempdir
## usethis namespace: end
NULL
11 changes: 9 additions & 2 deletions R/setup_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
#' # create package "mypackage" in temporary directory with
#' # the core packages dplyr, glue and purrr
#' withr::with_tempdir({
#' install.packages(c("dplyr", "glue", "purrr"), repos = "http://cran.us.r-project.org")
#' setup_package(path = tempdir(), packagename = "mypackage", core = c("dplyr", "glue", "purrr"))
#' install.packages(
#' c("dplyr", "glue", "purrr"),
#' repos = "http://cran.us.r-project.org"
#' )
#' setup_package(
#' path = tempdir(),
#' packagename = "mypackage",
#' core = c("dplyr", "glue", "purrr")
#' )
#' })
#' }
setup_package <- function(path, packagename, core = NULL) {
Expand Down
15 changes: 12 additions & 3 deletions R/update_core.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ update_core <- function(path, packagename, core = NULL, append = TRUE) {
purrr::walk(core, check_for_package)

# create the package and use the path for next steps
if (!is_package(path)) path <- fs::path_expand(glue::glue("{path}/{packagename}"))
if (!is_package(path)) {
path <- fs::path_expand(glue::glue("{path}/{packagename}"))
}

# move to the correct working directory
usethis::local_project(path)

# Remove deps if append = FALSE
if (!isTRUE(append)) {desc::desc_del_deps()}
if (!isTRUE(append)) {
desc::desc_del_deps()
}

# write new deps and tidy up DESCRIPTION
purrr::walk(c(core, "cli", "crayon", "rstudioapi"), use_dependency, "Imports")
Expand All @@ -43,7 +47,12 @@ update_core <- function(path, packagename, core = NULL, append = TRUE) {
) %>%
sort()

usethis::ui_info("If you really want to update your core you'll have to confirm the follwing dialogue...!\n")
output_string <- glue::glue(
"If you really want to update your core you'll have to",
"confirm the following dialogue...!"
)

usethis::ui_info("{output_string}\n")

# write new core file
usethis::write_over(
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ remotes::install_github("mrcaseb/personalr")

## One more thing

personalr is open source and it builds on top of other open source projects. However, maintaining this package will be a lot of work so I kindly ask you to consider donating at [patreon](https://patreon.com/mrcaseb).
personalr is open source and it builds on top of other open source projects. However, maintaining this package will be a lot of work so I kindly ask you to consider donating at [patreon](https://www.patreon.com/mrcaseb).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ You can install the development version from
personalr is open source and it builds on top of other open source
projects. However, maintaining this package will be a lot of work so I
kindly ask you to consider donating at
[patreon](https://patreon.com/mrcaseb).
[patreon](https://www.patreon.com/mrcaseb).
23 changes: 22 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
## Test environments
* local R installation, R 4.0.3
* ubuntu 16.04 (on travis-ci), R 4.0.3
* Debian Linux, R-devel, clang, ISO-8859-15 locale
* Debian Linux, R-devel, GCC
* Debian Linux, R-devel, GCC, no long double
* Debian Linux, R-patched, GCC
* Debian Linux, R-release, GCC
* Fedora Linux, R-devel, clang, gfortran
* Fedora Linux, R-devel, GCC
* CentOS 6, stock R from EPEL
* CentOS 6 with Redhat Developer Toolset, R from EPEL
* Debian Linux, R-devel, GCC ASAN/UBSAN
* macOS 10.13.6 High Sierra, R-release, brew
* macOS 10.13.6 High Sierra, R-release, CRAN's setup
* Oracle Solaris 10, x86, 32 bit, R-release
* Oracle Solaris 10, x86, 32 bit, R-release, Oracle Developer Studio 12.6
* Ubuntu Linux 16.04 LTS, R-devel, GCC
* Ubuntu Linux 16.04 LTS, R-release, GCC
* Ubuntu Linux 16.04 LTS, R-devel with rchk
* Windows Server 2008 R2 SP1, R-devel, 32/64 bit
* Windows Server 2008 R2 SP1, R-oldrel, 32/64 bit
* Windows Server 2008 R2 SP1, R-patched, 32/64 bit
* Windows Server 2008 R2 SP1, R-release, 32/64 bit
* ubuntu 16.04 (on travis-ci), R 4.0.2
* win-builder (devel)

## R CMD check results
Expand Down
11 changes: 8 additions & 3 deletions inst/templates/attach.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ same_library <- function(pkg) {

personalr_to_replace_attach <- function() {
to_load <- core_unloaded()
if (length(to_load) == 0)
if (length(to_load) == 0) {
return(invisible())
}

msg(
cli::rule(
left = crayon::bold("Attaching packages"),
right = crayon::cyan(crayon::bold(paste0("personalr_to_replace ", package_version("personalr_to_replace"))))
right = crayon::cyan(crayon::bold(paste0(
"personalr_to_replace ",
package_version("personalr_to_replace")
)))
),
startup = TRUE
)
Expand Down Expand Up @@ -51,7 +55,8 @@ package_version <- function(x) {
version <- as.character(unclass(utils::packageVersion(x))[[1]])

if (length(version) > 3) {
version[4:length(version)] <- crayon::yellow(as.character(version[4:length(version)]))
version[4:length(version)] <-
crayon::yellow(as.character(version[4:length(version)]))
}
paste0(version, collapse = ".")
}
19 changes: 14 additions & 5 deletions inst/templates/conflicts.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ personalr_to_replace_conflicts <- function() {

conflicts <- purrr::keep(objs, ~ length(.x) > 1)

personalr_to_replace_names <- paste0("package:", personalr_to_replace_packages())
personalr_to_replace_names <-
paste0("package:", personalr_to_replace_packages())
conflicts <- purrr::keep(conflicts, ~ any(.x %in% personalr_to_replace_names))

conflict_funs <- purrr::imap(conflicts, confirm_conflict)
Expand All @@ -15,7 +16,9 @@ personalr_to_replace_conflicts <- function() {
}

personalr_to_replace_conflict_message <- function(x) {
if (length(x) == 0) return("")
if (length(x) == 0) {
return("")
}

header <- cli::rule(
left = crayon::bold("Conflicts"),
Expand All @@ -30,7 +33,11 @@ personalr_to_replace_conflict_message <- function(x) {
)

winner <- pkgs %>% purrr::map_chr(1)
funs <- format(paste0(crayon::blue(winner), "::", crayon::green(paste0(names(x), "()"))))
funs <- format(paste0(
crayon::blue(winner),
"::",
crayon::green(paste0(names(x), "()"))
))
bullets <- paste0(
crayon::red(cli::symbol$cross), " ", funs,
" masks ", other_calls,
Expand All @@ -52,14 +59,16 @@ confirm_conflict <- function(packages, name) {
purrr::map(~ get(name, pos = .)) %>%
purrr::keep(is.function)

if (length(objs) <= 1)
if (length(objs) <= 1) {
return()
}

# Remove identical functions
objs <- objs[!duplicated(objs)]
packages <- packages[!duplicated(packages)]
if (length(objs) == 1)
if (length(objs) == 1) {
return()
}

packages
}
Expand Down
11 changes: 9 additions & 2 deletions man/setup_package.Rd

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

0 comments on commit 43f2dcc

Please sign in to comment.