Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-607

Mechanism for deprecating Config Fields

    Details

      Description

      While working on DM-20154, I wanted to mark a Config field as deprecated, but we have no system for doing that (other than just adding a docstring). Kian-Tat Lim suggested an approach on slack, which I have implemented in DM-20378. An update to the developer guide is in progress.

      This design adds a deprecated attribute to pex.config.Field, which defaults to None. If it is not None, it is appended to the docstring of the Field, which lets it be preserved when the Config is saved. For example, if we have Field(doc="Some Text", deprecated="to remove in v1234"), the docstring for field would be "Some Text. Deprecated: to remove in v1234".

      The Field will also emit a FutureWarning if a value is assigned to it, to inform users about the deprecation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Parejkoj John Parejko
                Reporter:
                Parejkoj John Parejko
                Watchers:
                John Parejko, John Swinbank, Jonathan Sick, Kian-Tat Lim, Krzysztof Findeisen, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Planned End:

                  Summary Panel