tantale / deprecated

Python @deprecated decorator to deprecate old python classes, functions or methods.
MIT License
298 stars 32 forks source link

Sphinx directives require version argument #40

Closed auscompgeek closed 3 years ago

auscompgeek commented 3 years ago

The Sphinx versionadded, versionchanged, and deprecated directives have a non-optional version argument. However, Deprecated will happily generate a Sphinx directive that is missing the version argument:

https://github.com/tantale/deprecated/blob/a02525b4f6e112743e1142fc9735dd4d46a4c66e/deprecated/sphinx.py#L100

tantale commented 3 years ago

The Sphinx build shows a warning similar to:

reading sources... [100%] api                                                                                           
[...]/deprecated_demo/sphinx/main.py:docstring of deprecated_demo.sphinx.main.add:7: WARNING: Error in "deprecated" directive:
1 argument(s) required, 0 supplied.

.. deprecated::

The user (who is a developer) can easily fix this problem in its own code.

auscompgeek commented 3 years ago

Problem is though if you specify a reason without a version, there's no warning; the first word is silently considered to be the version.