Open cbeleites opened 3 years ago
(May be an issue of hySpc.testthat::unittest()
)
Here's what I get after remove.packages("hyperSpec")
, load_all()
and then test()
.
✖ | 0 1 | plotspc
────────────────────────────────────────────────────────────────────────────────
Error (test-plotspc.r:4:3): BARBITURATES
Error: object 'barbiturates' not found
Backtrace:
1. testthat::expect_silent(spc <- do.call(collapse, barbiturates[1:3])) test-plotspc.r:4:2
9. base::do.call(collapse, barbiturates[1:3])
────────────────────────────────────────────────────────────────────────────────
══ Results ═════════════════════════════════════════════════════════════════════
Duration: 22.0 s
── Skipped tests ──────────────────────────────────────────────────────────────
• empty test (7)
• file import test files not installed (26)
• no spc files with empty spectra available so far (1)
• skip (1)
• TODO: implement (1)
[ FAIL 10 | WARN 14 | SKIP 36 | PASS 761 ]
══ Terminated early ════════════════════════════════════════════════════════════
Warning messages:
1: In setup_ns_exports(path, export_all, export_imports) :
Objects listed as exports, but not present in namespace: hy_list_available_hySpc_packages
2: In setup_ns_exports(path, export_all, export_imports) :
Objects listed as exports, but not present in namespace: hy_list_available_hySpc_packages
2021-07-30 14:31:45.954 R[65098:1109795] +[NSSavePanel _warmUp] attempted warmup
When I build with a makefile (my usual process), the same export issue is reported but unit tests pass:
Research/R_Pkgs> make -f makefile_hyperSpec
cd hyperSpec; echo "# Generated by roxygen2: do not edit by hand" >> NAMESPACE
cd hyperSpec; R --no-init-file -e 'devtools::document(roclets = c("rd", "collate", "namespace", "vignette"))'
R version 4.1.0 Patched (2021-07-03 r80596) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> devtools::document(roclets = c("rd", "collate", "namespace", "vignette"))
ℹ Updating hyperSpec documentation
ℹ Loading hyperSpec
Loading required package: lattice
Loading required package: grid
Loading required package: ggplot2
Creating a generic function for ‘apply’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘cov’ from package ‘stats’ in package ‘hyperSpec’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘rownames’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘rownames<-’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘colnames’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘sample’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘sweep’ from package ‘base’ in package ‘hyperSpec’
Package hyperSpec (version 0.100.0.9000)
To get started, try:
vignette("hyperSpec", package = "hyperSpec")
package?hyperSpec
browseVignettes(package = "hyperSpec")
vignette(package = "hyperSpec")
If you use this package, please cite it appropriately.
The correct reference is given by:
citation("hyperSpec")
The project's website:
https://r-hyperspec.github.io/hyperSpec
Writing NAMESPACE
Deleting hy_list_available_hySpc_packages.Rd
Writing NAMESPACE
Updating vignettes
Warning message:
In setup_ns_exports(path, export_all, export_imports) :
Objects listed as exports, but not present in namespace: hy_list_available_hySpc_packages
>
>
R --no-init-file CMD build --resave-data --compact-vignettes=both hyperSpec
* checking for file ‘hyperSpec/DESCRIPTION’ ... OK
* preparing ‘hyperSpec’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* re-saving image files
* building ‘hyperSpec_0.100.0.9000.tar.gz’
export _R_CHECK_CRAN_INCOMING_=FALSE; \
R --no-init-file CMD check --as-cran hyperSpec_0.100.0.9000.tar.gz
* using log directory ‘/Users/bryanhanson/Documents/Professional/Research/R_Pkgs/hyperSpec.Rcheck’
* using R version 4.1.0 Patched (2021-07-03 r80596)
* using platform: x86_64-apple-darwin17.0 (64-bit)
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘hyperSpec/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘hyperSpec’ version ‘0.100.0.9000’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘hyperSpec’ can be installed ... OK
* checking installed package size ... NOTE
installed size is 7.1Mb
sub-directories of 1Mb or more:
doc 5.3Mb
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking R/sysdata.rda ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘testthat.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 NOTE
See
‘/Users/bryanhanson/Documents/Professional/Research/R_Pkgs/hyperSpec.Rcheck/00check.log’
for details.
R --no-init-file CMD INSTALL hyperSpec_0.100.0.9000.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library’
* installing *source* package ‘hyperSpec’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Creating a generic function for ‘apply’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘cov’ from package ‘stats’ in package ‘hyperSpec’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘rownames’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘rownames<-’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘colnames’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘sample’ from package ‘base’ in package ‘hyperSpec’
Creating a generic function for ‘sweep’ from package ‘base’ in package ‘hyperSpec’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (hyperSpec)
@bryanhanson: yes thanks.
Note to self at end of day: hySpc.testthat::unittest()
should first check whether ns %in% devtools::dev_packages()
. If so, it's a package loaded by devtools.
In that case, look recursively through parent.env(.GlobalEnv)
for paste0("package:", ns)
.
If another namespace is requested, use getNamespace()
is the way to go.
It's not clear to me: is this issue (#23) blocked ⛔ until the following issue is solved?
@GegznaV yes
I think, hyperSpec 1.0.0 can work without these changes, so I'll change the milestone.
If it is fixed sooner, it's ok.
When I have
devtools::load_all()
the current develop branch and thendevtools::test()
I get test failures.
When the develop version of hyperSpec is installed, the tests run smoothly.