Add a way to deprecate options with 'deprecated_version' and 'deprecated_hint' kwargs to register()

Review Request #1814 - Created Feb. 21, 2015 and submitted

Information
Eric Ayers
pants
zundel/deprecated_options
1152
66b26f8...
Reviewers
pants-reviews
benjyw, jsirois

Followon to discussion in https://rbcommons.com/s/twitter/r/1799/ about deprecating options.

  • Register the help with a deprecation message
  • When a deprecated argument is invoked, print the deprecation message to stderr
  • Refactored @deprecated to re-use logic for deprecation warning on options.
  • Add a deprecation message to the --color option for SpecsRun

Added automated tests to test_deprecated.py and test_options.py

See CI status by clicking on Bugs link in rbcommons.

Manual testing:

devpants test.specs --color
...

*** Option --color in scope test.specs is deprecated and will be removed in version 0.0.30. Use the --no-colors instead.

devpants test.specs --color

*** Option --no-color in scope test.specs is deprecated and will be removed in version 0.0.30. Use the --no-colors instead.

Also, I temporarily registered a deprecation hint on --colors on the global scope to test it.

Issues

  • 0
  • 3
  • 0
  • 3
Description From Last Updated
Eric Ayers
Benjy Weinberger
John Sirois
Nick Howard (Twitter)
Eric Ayers
Nick Howard (Twitter)
John Sirois
Eric Ayers
John Sirois
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks Nick, John & Benjy. Commit df50472

Loading...