From 2d46e2ff47a2a5ecf013c97c8b870415dfbea30a Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Sun, 17 Sep 2023 07:05:47 -0500 Subject: [PATCH] Release S7 0.1.1 (#362) * Polish news * Update all GitHub urls * Fix call. typo * Update CRAN comments * Increment version number to 0.1.1 --- DESCRIPTION | 4 ++-- NEWS.md | 24 ++++++++++++------------ R/property.R | 2 +- README.Rmd | 2 +- README.md | 4 ++-- cran-comments.md | 12 +----------- tests/testthat/test-base-r.R | 2 +- vignettes/minutes/2021-05-18.Rmd | 2 +- vignettes/minutes/2022-02-12.Rmd | 10 +++++----- vignettes/minutes/2022-03-08.Rmd | 20 ++++++++++---------- vignettes/minutes/2022-08-01.Rmd | 2 +- vignettes/packages.Rmd | 6 +++--- vignettes/spec/requirements.Rmd | 2 +- 13 files changed, 41 insertions(+), 51 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index aa970e60..0fb2800b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: S7 Title: An Object Oriented System Meant to Become a Successor to S3 and S4 -Version: 0.1.0.9000 +Version: 0.1.1 Authors@R: c( person("Object-Oriented Programming Working Group", role = "cph"), person("Davis", "Vaughan", role = "aut"), @@ -25,7 +25,7 @@ Description: A new object oriented programming system designed to be a successor License: MIT + file LICENSE URL: https://github.com/rconsortium/S7/, https://rconsortium.github.io/S7/ -BugReports: https://github.com/rconsortium/OOP-WG/issues +BugReports: https://github.com/rconsortium/S7/issues Depends: R (>= 3.5.0) Imports: diff --git a/NEWS.md b/NEWS.md index 031f796a..af26100e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,36 +1,36 @@ -# S7 (development version) - -* `S7_inherits()` now accepts `class = NULL` to test if an object is any - sort of S7 object (#347). +# S7 0.1.1 * Classes get a more informative print method (#346). +* Correctly register S3 methods for S7 objects with a package (#333). + * External methods are now registered using an attribute of the S3 methods table rather than an element of that environment. This prevents a warning being generated during the "code/documentation mismatches" check in `R CMD check` (#342). +* `class_missing` and `class_any` can now be unioned with `|` (#337). + * `new_object()` no longer accepts `NULL` as `.parent`. * `new_object()` now correctly runs the validator from abstract parent classes (#329). +* `new_object()` works better when custom property setters modify other + properties. + * `new_property()` gains a `validator` argument that allows you to specify a per-property validator (#275). -* `class_missing` and `class_any` can now be unioned with `|` (#337). - -* `new_object()` works better when custom property setters modify other - properties. +* `new_property()` clarifies that it's the user's responsibility to return + the correct class; it is _not_ automatically validated. * Properties with a custom setter are now validated _after_ the setter has run and are validated when the object is constructed or when you call `validate()`, not just when you modify them after construction. -* In `new_property()` clarify that it's the user's responsibility to return - the correct class; it is _not_ automatically validated. - -* Correctly register S3 methods for S7 objects with a package (#333). +* `S7_inherits()` now accepts `class = NULL` to test if an object is any + sort of S7 object (#347). # S7 0.1.0 diff --git a/R/property.R b/R/property.R index d0c0f498..96aadc84 100644 --- a/R/property.R +++ b/R/property.R @@ -218,7 +218,7 @@ prop_obj <- function(object, name) { if (isTRUE(check)) { error <- prop_validate(prop, value, object) if (!is.null(error)) { - stop(error, call. = TRUE) + stop(error, call. = FALSE) } } diff --git a/README.Rmd b/README.Rmd index ec1147f6..cfa0e30c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( -[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![R-CMD-check](https://github.com/RConsortium/OOP-WG/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RConsortium/OOP-WG/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/RConsortium/OOP-WG/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RConsortium/OOP-WG?branch=main) +[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![R-CMD-check](https://github.com/RConsortium/S7/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RConsortium/S7/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/RConsortium/S7/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RConsortium/S7?branch=main) diff --git a/README.md b/README.md index dd0533c9..6fccc505 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![R-CMD-check](https://github.com/RConsortium/OOP-WG/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RConsortium/OOP-WG/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/RConsortium/S7/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RConsortium/S7/actions/workflows/R-CMD-check.yaml) [![Codecov test -coverage](https://codecov.io/gh/RConsortium/OOP-WG/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RConsortium/OOP-WG?branch=main) +coverage](https://codecov.io/gh/RConsortium/S7/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RConsortium/S7?branch=main) diff --git a/cran-comments.md b/cran-comments.md index 56c6e932..0037a2f6 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,13 +1,3 @@ -This is a resubmission. - -* There are no references to add to the description. -* I have added the missing `\value{}` documentation. -* I no longer create S4 classes in the global environment in tests. - ---- - ## R CMD check results -0 errors | 0 warnings | 1 note - -* This is a new release. +0 errors | 0 warnings | 0 notes diff --git a/tests/testthat/test-base-r.R b/tests/testthat/test-base-r.R index 2b6b5d18..cd37e595 100644 --- a/tests/testthat/test-base-r.R +++ b/tests/testthat/test-base-r.R @@ -57,7 +57,7 @@ test_that("base::`@` accesses S7 properties", { test_that("dput() works", { skip_if(getRversion() < "4.3") - skip("dput() not fixed yet; https://github.com/RConsortium/OOP-WG/issues/272") + skip("dput() not fixed yet; https://github.com/RConsortium/S7/issues/272") expect_no_error(dput(new_class("Foo")())) expect_no_error(dput(new_class("Foo"))) diff --git a/vignettes/minutes/2021-05-18.Rmd b/vignettes/minutes/2021-05-18.Rmd index 2960fdec..3d0012c7 100644 --- a/vignettes/minutes/2021-05-18.Rmd +++ b/vignettes/minutes/2021-05-18.Rmd @@ -8,7 +8,7 @@ title: "Minutes 2021-05-18" ### Process (ML) -- Active discussion in GitHub issues: +- Active discussion in GitHub issues: - Need a little process to finalise discussion. Proposal: original author reads discussion, summarises, and creates a pull request that closes the issue. Any participants in the discussion should be added as reviewers. diff --git a/vignettes/minutes/2022-02-12.Rmd b/vignettes/minutes/2022-02-12.Rmd index 81c70b9c..76925e49 100644 --- a/vignettes/minutes/2022-02-12.Rmd +++ b/vignettes/minutes/2022-02-12.Rmd @@ -16,7 +16,7 @@ No semantic changes without discussion in issues - Numeric, atomic, and vector "types" as S7 unions. - Should we provide some wrappers to base unions and consider if we could get rid of string representation altogether? (e.g. `base_atomic`) - New `s3_class()` to define S3 classes. - - makes it possible for S7 class to extend an S3 class + - makes it possible for S7 class to extend an S3 class - Should we export the S3 class definitions for common base S3 classes? And then provide with `base_factor` etc. - S4 unions converted to S7 unions - Method registration @@ -53,9 +53,9 @@ No semantic changes without discussion in issues - Next time we meet, we should discuss other ways to advertise - Ok to rename default branch from master to main? \~5 minutes work and unlikely to cause any problems. -- Ok to eliminate `prop_safely()`? -- Convention for displaying class names: / +- Ok to eliminate `prop_safely()`? +- Convention for displaying class names: / - Only show for S3/S4 -- Name of sentinel for missing/any dispatch: +- Name of sentinel for missing/any dispatch: - `_arg` looks good -- Coercion: +- Coercion: diff --git a/vignettes/minutes/2022-03-08.Rmd b/vignettes/minutes/2022-03-08.Rmd index c7f9b1f4..39e12d6f 100644 --- a/vignettes/minutes/2022-03-08.Rmd +++ b/vignettes/minutes/2022-03-08.Rmd @@ -5,7 +5,7 @@ title: "Minutes 2022-03-08" ## Changes - Website updates (): refreshed readme, minutes as articles. - Working on documentation overhaul in . + Working on documentation overhaul in . - `new_generic()` now requires `dispatch_args`. This means that `new_generic()` will typically be called without names: @@ -21,17 +21,17 @@ title: "Minutes 2022-03-08" - `new_class("foo", properties = list(x = integer, y = double))@constructor` - - + - - See other minor changes in\ - + ## Discussion -- Rename `method_call()`? --- `S7_dispatch()` sounds good. -- Abstract classes? . Easy to implement but is it worth it? -- What should we call the S7 equivalent of inherits? --- call it `S7_inherits()` for now; will eventually just be part of inherits. Propose generic extension mechanism for inherits. -- Explicit S4 registration: -- New names for base types? --- `class_` sounds good. -- Convert and super: -- Should we offer encapsulated OO? +- Rename `method_call()`? --- `S7_dispatch()` sounds good. +- Abstract classes? . Easy to implement but is it worth it? +- What should we call the S7 equivalent of inherits? --- call it `S7_inherits()` for now; will eventually just be part of inherits. Propose generic extension mechanism for inherits. +- Explicit S4 registration: +- New names for base types? --- `class_` sounds good. +- Convert and super: +- Should we offer encapsulated OO? diff --git a/vignettes/minutes/2022-08-01.Rmd b/vignettes/minutes/2022-08-01.Rmd index 86ce367b..f68e32e5 100644 --- a/vignettes/minutes/2022-08-01.Rmd +++ b/vignettes/minutes/2022-08-01.Rmd @@ -14,6 +14,6 @@ title: "Minutes 2022-08-08" * R-core meeting in Vienna (Sept). ML to present S7 work and hopefully get some buy-in. -* Base patches? (https://github.com/RConsortium/OOP-WG/issues/222) +* Base patches? (https://github.com/RConsortium/S7/issues/222) * Get to CRAN to get more exposure and figure out how to get into base R itself. diff --git a/vignettes/packages.Rmd b/vignettes/packages.Rmd index 3ecba41e..731d3e39 100644 --- a/vignettes/packages.Rmd +++ b/vignettes/packages.Rmd @@ -16,7 +16,7 @@ knitr::opts_chunk$set( This vignette outlines the most important things you need to know about using S7 in a package. S7 is new, so few people have used it in a package yet; this means that this vignette is likely incomplete, and we'd love your help to make it better. -Please [let us know](https://github.com/RConsortium/OOP-WG/issues/new) if you have questions that this vignette doesn't answer. +Please [let us know](https://github.com/RConsortium/S7/issues/new) if you have questions that this vignette doesn't answer. ```{r setup} library(S7) @@ -46,11 +46,11 @@ If you export a class, you must also set the `package` argument, ensuring that c You should document generics like regular functions (since they are!). If you expect others to create their own methods for your generic, you may want to include an section describing the the properties that you expect all methods to have. We plan to provide a an easy way to all methods for a generic, but have not yet implemented it. -You can track progress at . +You can track progress at . We don't currently have any recommendations on documenting methods. There's no need to document them in order to pass `R CMD check`, but obviously there are cases where it's nice to provide additional details for a method, particularly if it takes extra arguments compared to the generic. -We're tracking that issue at . +We're tracking that issue at . ## Backward compatibility diff --git a/vignettes/spec/requirements.Rmd b/vignettes/spec/requirements.Rmd index 503ca4d0..08c385e8 100644 --- a/vignettes/spec/requirements.Rmd +++ b/vignettes/spec/requirements.Rmd @@ -5,7 +5,7 @@ description: > --- -This page is for brainstorming on the technical requirements for solving our [problem](https://github.com/RConsortium/OOP-WG/wiki/Problem-Statement). +This page is for brainstorming on the technical requirements for solving our [problem](https://github.com/RConsortium/S7/wiki/Problem-Statement). Once we align on the requirements, we can start the design process. ## List of requirements