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

Suggest stringr as needed by starter::create_project() #47

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Suggest stringr as needed by starter::create_project() #47

merged 1 commit into from
Mar 5, 2024

Conversation

yihui
Copy link
Contributor

@yihui yihui commented Mar 5, 2024

Previously this soft dependency doesn't need to be explicitly declared because rmarkdown has been suggested, which requires stringr (which in turn requires stringi). Now the dependency is no longer guaranteed in rmarkdown (rstudio/rmarkdown#2530), so starter has to explicitly declare the dependency, otherwise it will fail R CMD check:

── Failure ('test-create_project.R:6:3'): create_project() works ───────────────
    `create_project(...)` threw an unexpected error.
    Message: there is no package called 'stringr'
    Class:   packageNotFoundError/error/condition
    Backtrace:
         ▆
      1. ├─testthat::expect_error(...) at test-create_project.R:6:3
      2. │ └─testthat:::expect_condition_matching(...)
      3. │   └─testthat:::quasi_capture(...)
      4. │     ├─testthat (local) .capture(...)
      5. │     │ └─base::withCallingHandlers(...)
      6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
      7. └─starter::create_project(...)
      8.   └─starter:::evaluate_project_template(...)
      9.     └─base::tryCatch(...)
     10.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
     11.         └─base (local) tryCatchOne(...)
     12.           └─value[[3L]](cond)
    ── Failure ('test-create_project.R:19:3'): create_project() works ──────────────
    `create_project(...)` threw an unexpected error.
    Message: there is no package called 'stringr'
    Class:   packageNotFoundError/error/condition
    Backtrace:
         ▆
      1. ├─testthat::expect_error(...) at test-create_project.R:19:3
      2. │ └─testthat:::expect_condition_matching(...)
      3. │   └─testthat:::quasi_capture(...)
      4. │     ├─testthat (local) .capture(...)
      5. │     │ └─base::withCallingHandlers(...)
      6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
      7. └─starter::create_project(...)
      8.   └─starter:::evaluate_project_template(...)
      9.     └─base::tryCatch(...)
     10.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
     11.         └─base (local) tryCatchOne(...)
     12.           └─value[[3L]](cond)
    ── Failure ('test-create_project.R:32:3'): create_project() works ──────────────
    `create_project(...)` threw an unexpected error.
    Message: there is no package called 'stringr'
    Class:   packageNotFoundError/error/condition
    Backtrace:
         ▆
      1. ├─testthat::expect_error(...) at test-create_project.R:32:3
      2. │ └─testthat:::expect_condition_matching(...)
      3. │   └─testthat:::quasi_capture(...)
      4. │     ├─testthat (local) .capture(...)
      5. │     │ └─base::withCallingHandlers(...)
      6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
      7. └─starter::create_project(...)
      8.   └─starter:::evaluate_project_template(...)
      9.     └─base::tryCatch(...)
     10.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
     11.         └─base (local) tryCatchOne(...)
     12.           └─value[[3L]](cond)
    ── Error ('test-create_project.R:44:3'): create_project() works ────────────────
    Error in `setwd(proj_dir)`: cannot change working directory
    Backtrace:
        ▆
     1. └─base::setwd(proj_dir) at test-create_project.R:44:3

    [ FAIL 4 | WARN 0 | SKIP 0 | PASS 10 ]
    Error: Test failures
    Execution halted

Previously this soft dependency doesn't need to be explicitly declared because **rmarkdown** has been suggested, which requires **stringr** (which in turn requires **stringi**). Now the dependency is no longer guaranteed in **rmarkdown** (rstudio/rmarkdown#2530), so **starter** has to explicitly declare the dependency, otherwise it will fail `R CMD check`.
@yihui yihui changed the title Suggest stringr as needed by create_project() Suggest stringr as needed by starter::create_project() Mar 5, 2024
@ddsjoberg ddsjoberg self-requested a review March 5, 2024 15:50
Copy link
Owner

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you kindly for the PR @yihui !

@ddsjoberg ddsjoberg merged commit d043668 into ddsjoberg:main Mar 5, 2024
11 checks passed
@yihui yihui deleted the patch-1 branch March 5, 2024 18:18
@yihui
Copy link
Contributor Author

yihui commented Mar 5, 2024

You are welcome! It will be great if you can make a new CRAN release in the near future to avoid R CMD check failures there (sorry for the trouble!).

@ddsjoberg
Copy link
Owner

@yihui new version already submitted and accepted to CRAN , woohoo!

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

Successfully merging this pull request may close these issues.

2 participants