Skip to content

Commit

Permalink
Merge pull request #627 from DyfanJones/paws-pkg-list
Browse files Browse the repository at this point in the history
tidy up how paws packages are listed
  • Loading branch information
DyfanJones authored Jun 20, 2023
2 parents 0287e75 + eeddc2d commit 2aabd00
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 110 deletions.
14 changes: 12 additions & 2 deletions make.paws/R/sdk_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,18 @@ check_pkgs <- function(pkgs, keep_notes = FALSE){

# list paws packages
list_paws_pkgs <- function(in_dir = "../cran", pkg_list = list()){
pkgs <- list.dirs(in_dir, recursive = FALSE)
pkgs <- pkgs[grepl("paws", pkgs)]
all_pkgs <- list.files(in_dir)

# list active files
lines <- readLines(file.path(in_dir, "paws", "DESCRIPTION"))
pkgs <- lines[grepl("paws\\.[a-z\\.]", lines, perl = T)]
pkgs <- trimws(gsub("\\([^)]*\\).*", "", pkgs))

# pick up any sub categories
active_pkgs <- all_pkgs[unlist(lapply(pkgs, grep, x= all_pkgs))]
pkgs <- file.path(in_dir,c("paws", active_pkgs))

# filter on pkg list
if(any(nzchar(pkg_list))) pkgs <- pkgs[basename(pkgs) %in% pkg_list]
return(pkgs)
}
Expand Down
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions make.paws/tests/testthat/dummy/pkg3/paws/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: pkg1
Title: dummy
Version: 0.1.0
Authors@R: c(
person("David", "Kretch", , "david.kretch@gmail.com", role = "aut"),
person("Adam", "Banker", , "adam.banker39@gmail.com", role = "aut"),
person("Dyfan", "Jones", , "dyfan.r.jones@gmail.com", role = "cre"),
person("Amazon.com, Inc.", role = "cph")
)
Description: Dummy package
License: Apache License (>= 2.0)
Imports:
paws.cat1 (>= 0.1.0),
paws.cat2 (>= 0.1.0),
fake
Suggests:
testthat
Encoding: UTF-8
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate"))
RoxygenNote: 7.2.3
Empty file.
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions make.paws/tests/testthat/dummy/pkg4/paws/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: pkg1
Title: dummy
Version: 0.1.0
Authors@R: c(
person("David", "Kretch", , "david.kretch@gmail.com", role = "aut"),
person("Adam", "Banker", , "adam.banker39@gmail.com", role = "aut"),
person("Dyfan", "Jones", , "dyfan.r.jones@gmail.com", role = "cre"),
person("Amazon.com, Inc.", role = "cph")
)
Description: Dummy package
License: Apache License (>= 2.0)
Imports:
paws.cat1 (>= 0.1.0),
paws.cat2 (>= 0.1.0),
fake
Suggests:
testthat
Encoding: UTF-8
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate"))
RoxygenNote: 7.2.3
Loading

0 comments on commit 2aabd00

Please sign in to comment.