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

Initial infrastructure for editions #6203

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link
Collaborator

This PR aims to adress a topic discussed by Thomas and me off-github.

Briefly, we'd like to bring edition structure to ggplot2 to opt-in otherwise backward incompatible changes. It is modelled after testthat, with a few adaptations. This PR just aims to introduce infrastructure for working with editions in ggplot2.

The most important difference with testthat is in the relation that it has to other packages. The testthat package has 1:1 relationships: the tests of one single package does not affect tests in a second package. In contrast, it is not unreasonable to assume that for example {extensionPkg} defines ggplot2 extensions, which are then subsequently used by wrappers in {wrapperPkg}. In this example {extensionPkg} and {wrapperPkg} might opt-in different editions, which needs to be facilitated. For this reason, this PR gives each package their own local edition.

This PR is currently marked WIP as some details need to be ironed out. Specifically:

  • How do we expect maintainers of reverse dependencies to interact with the edition system?
  • How do we expect users to interact with the edition system?
  • What type of things do we want to edition?

DESCRIPTION Outdated Show resolved Hide resolved
@teunbrand teunbrand added this to the Editioning milestone Nov 26, 2024
@teunbrand
Copy link
Collaborator Author

Add a few example cases to edition

R/edition.R Outdated Show resolved Hide resolved
@teunbrand
Copy link
Collaborator Author

teunbrand commented Jan 6, 2025

To answer some of the questions:

How do we expect maintainers of reverse dependencies to interact with the edition system?

I think we expect maintainers to:

  • Opt-in the 2025 edition by setting a 'Config/ggplot2/edition' value in their DESCRIPTION file.
  • Use edition_require() whenever implementing features that rely on new editions.
  • Use edition_deprecate() whenever they want to deprecate something along with ggplot2 editions.

How do we expect users to interact with the edition system?

I don't have a full answer yet. Currently they can use local_edition(2025) to opt-in newer features. I think it would be neat if we can have regular users opt-out of the 2025 edition while having packages opt-in, but this seems counterintuitive to implement.

@teunbrand teunbrand marked this pull request as ready for review January 14, 2025 10:02
@teunbrand teunbrand changed the title WIP: Initial infrastructure for editions Initial infrastructure for editions Jan 14, 2025
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