Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DESCRIPTION should require minimum version for raster to avoid test failures #881

Closed
barracuda156 opened this issue Sep 6, 2023 · 8 comments

Comments

@barracuda156
Copy link

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.8.0 (32-bit)

> library(testthat)
> library(leaflet)
> 
> test_check("leaflet")
The legacy packages maptools, rgdal, and rgeos, underpinning this package
will retire shortly. Please refer to R-spatial evolution reports on
https://r-spatial.org/r/2023/05/15/evolution4.html for details.
This package is now running under evolution status 0 
terra 1.7.46

Attaching package: 'terra'

The following objects are masked from 'package:testthat':

    compare, describe

Loading required package: sp
[ FAIL 1 | WARN 0 | SKIP 7 | PASS 136 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════
• On CRAN (2)
• sf cannot be loaded (5)

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-raster.R:25:3'): rasters ───────────────────────────────────────
Error in `.rawTransform(projfrom, projto, xy)`: no slot of name "ptr" for this object of class "SpatVector"
Backtrace:
    ▆
 1. └─leaflet::projectRasterForLeaflet(raster(lux), "bilinear") at test-raster.R:25:2
 2.   ├─raster::projectRaster(...)
 3.   │ └─raster:::.getSRS(to)
 4.   │   └─methods::extends(class(x), "CRS")
 5.   └─raster::projectExtent(x, crs = sp::CRS(epsg3857))
 6.     └─raster:::.rawTransform(projfrom, projto, xy)

[ FAIL 1 | WARN 0 | SKIP 7 | PASS 136 ]
Error: Test failures
Execution halted

P. S. sf tests skipped, since sf does not build in Rosetta, and I am away from the native hardware atm.

@gadenbuie
Copy link
Member

Can you provide the complete results of devtools::session_info()? It would be helpful to know which versions of sp, raster and others you're using here. Thanks!

@barracuda156
Copy link
Author

barracuda156 commented Sep 7, 2023

@gadenbuie Sure:

10:~ svacchanda$ r

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.8.0 (32-bit)

> library(leaflet)
> library(devtools)
Loading required package: usethis
> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.0 (2023-04-21)
 os       OS X Snow Leopard 10.6.8
 system   powerpc, darwin10.8.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Asia/Jakarta
 date     2023-09-08
 pandoc   NA

─ Packages ───────────────────────────────────────────────────────────────────
 package           * version    date (UTC) lib source
 cachem              1.0.8      2023-05-08 [1] local
 callr               3.7.3      2023-05-09 [1] local
 cli                 3.6.1.9000 2023-05-23 [1] https://r-lib.r-universe.dev (R 4.3.0)
 codetools           0.2-19     2023-02-01 [1] CRAN (R 4.3.0)
 crayon              1.5.2      2022-09-29 [1] CRAN (R 4.3.0)
 crosstalk           1.2.0      2021-11-04 [1] CRAN (R 4.3.0)
 devtools          * 2.4.5      2023-06-01 [1] local
 digest              0.6.31     2022-12-11 [1] CRAN (R 4.3.0)
 ellipsis            0.3.2      2023-05-08 [1] local
 fastmap             1.1.1      2023-05-08 [1] local
 fs                  1.6.2      2023-04-25 [1] CRAN (R 4.3.0)
 glue                1.6.2      2023-05-08 [1] local
 htmltools           0.5.5      2023-03-23 [1] CRAN (R 4.3.0)
 htmlwidgets         1.6.1      2023-05-16 [1] local
 httpuv              1.6.10     2023-05-08 [1] CRAN (R 4.3.0)
 later               1.3.1      2023-05-09 [1] local
 lattice             0.21-8     2023-04-05 [1] CRAN (R 4.3.0)
 leaflet           * 2.2.0      2023-09-06 [1] local
 leaflet.providers * 1.13.0     2023-09-06 [1] local
 lifecycle           1.0.3      2023-05-08 [1] local
 magrittr            2.0.3      2023-05-08 [1] local
 maps              * 3.4.1      2022-10-30 [1] CRAN (R 4.3.0)
 memoise             2.0.1      2023-05-09 [1] local
 mime                0.12       2023-05-09 [1] local
 miniUI              0.1.1.1    2018-05-18 [1] CRAN (R 4.3.0)
 pkgbuild            1.4.1      2023-06-14 [1] local
 pkgload             1.3.2      2023-05-09 [1] local
 prettyunits         1.1.1      2023-05-08 [1] local
 processx            3.8.1      2023-04-18 [1] CRAN (R 4.3.0)
 profvis             0.3.8      2023-05-02 [1] CRAN (R 4.3.0)
 promises            1.2.0.1    2021-02-11 [1] CRAN (R 4.3.0)
 ps                  1.7.5.9000 2023-05-23 [1] https://r-lib.r-universe.dev (R 4.3.0)
 purrr               1.0.1      2023-01-10 [1] CRAN (R 4.3.0)
 R6                  2.5.1.9000 2023-05-23 [1] https://r-lib.r-universe.dev (R 4.3.0)
 raster            * 3.6-20     2023-03-06 [1] CRAN (R 4.3.0)
 Rcpp                1.0.10     2023-01-22 [1] CRAN (R 4.3.0)
 remotes             2.4.2.9000 2023-05-23 [1] https://r-lib.r-universe.dev (R 4.3.0)
 RJSONIO           * 1.3-1.8    2023-01-31 [1] CRAN (R 4.3.0)
 rlang               1.1.1.9000 2023-05-23 [1] https://r-lib.r-universe.dev (R 4.3.0)
 sessioninfo         1.2.2      2023-05-17 [1] local
 shiny               1.7.4      2022-12-15 [1] CRAN (R 4.3.0)
 sp                * 1.6-1      2023-05-31 [1] CRAN (R 4.3.0)
 stringi             1.7.12     2023-05-16 [1] local
 stringr             1.5.0      2023-05-09 [1] local
 terra             * 1.7-46     2023-09-06 [1] CRAN (R 4.3.0)
 urlchecker          1.0.1      2023-06-01 [1] local
 usethis           * 2.2.0      2023-06-06 [1] CRAN (R 4.3.0)
 vctrs               0.6.3      2023-06-14 [1] CRAN (R 4.3.0)
 xfun              * 0.39       2023-04-20 [1] CRAN (R 4.3.0)
 xtable              1.8-4      2019-04-21 [1] CRAN (R 4.3.0)

 [1] /opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library

@barracuda156
Copy link
Author

Let me update relevant packages and re-run tests. Maybe it is just that I have outdated versions on this specific machine.

@barracuda156
Copy link
Author

@gadenbuie Indeed, the issue was with some outdated dependency (raster, perhaps).
After updates, all tests pass.

However, perhaps DESCRIPTION should be updated to require a minimum version for it?

@barracuda156 barracuda156 changed the title 1 test fails: Error in .rawTransform(projfrom, projto, xy): no slot of name "ptr" for this object of class "SpatVector" DESCRIPTION should require minimum version for raster to avoid test failures Sep 7, 2023
@barracuda156
Copy link
Author

barracuda156 commented Sep 7, 2023

UPD. Irrelevant to leaflet, the problem is elsewhere. Can be ignored.

@gadenbuie Another issue, apparently tests do not get installed for some reason. I.e. they run fine from command line via Macports, but when I try to run them from R session, they are not found:

> library(testthat)
> library(leaflet)
> test_check("leaflet")
Error in `test_dir()`:
! No test files found
Run `rlang::last_trace()` to see where the error occurred.

> rlang::last_trace(drop = FALSE)
<error/rlang_error>
Error in `test_dir()`:
! No test files found
---
Backtrace:
    ▆
 1. └─testthat::test_check("leaflet")
 2.   └─testthat::test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
 3.     └─rlang::abort("No test files found")

@gadenbuie
Copy link
Member

@gadenbuie Indeed, the issue was with some outdated dependency (raster, perhaps).
After updates, all tests pass.

Do you know which packages were updated in this? One guess is that it might be sp that caused the issue since you updated from 1.6-1 and the current version on CRAN is 2.0-0.

But the code in the failing test was written about 14 months ago and the initial versions of raster and sp that you have were both released much more recently (raster 3.6-20 was released 2023-03 and sp 1.6-1 was released 2023-05-31). So this is feeling like it's much more likely that another package beside leaflet should be setting the minimum version requirement.

@barracuda156
Copy link
Author

@gadenbuie In fact I have overlooked update for sp, so it is definitely not because of it. I can revert updates selectively and re-run tests; anything besides raster to suspect? Blind search will be rather tedious.

@gadenbuie
Copy link
Member

I don't think there's anything leaflet can do here; but I'll be happy to adjust leaflet's DESCRIPTION if anyone has further information.

@gadenbuie gadenbuie closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants