laurent-laporte-pro / deprecated

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

Control sphinx width #33

Closed risoms closed 3 years ago

risoms commented 4 years ago

This issue tracker is a tool to address bugs in Deprecated itself. Please use Stack Overflow for general questions about using Deprecated or issues not related to Deprecated Library.

If you'd like to report a bug in Deprecated, fill out the template below. Provide any extra information that may be useful/related to your problem. Ideally, create an Minimal, Complete, and Verifiable example, which helps us understand the problem and helps check that it is not caused by something in your code.


Expected Behavior

I'm hoping to use the decorator to create sphinx output.

print(a.__doc__)
.. deprecated:: 3.0.35
   This staticmethod has been deprecated. :func:`get_it_id()` is
   recommended instead. Example:

   .. code-block:: python
      from test_lib_dry_lab.lib.aplace.anotherlongerplace import Lookup
      rwo = Lookup('ID222').item[0]
      rwo.get_it_id()
      'AY20'

Actual Behavior

When using sphinx to deprecate a function, I'm noticing its continuing text on a new line. Is there a way to prevent this?

.. deprecated:: 3.0.35
   This staticmethod has been deprecated. :func:`get_it_id()` is
   recommended instead. Example:

   .. code-block:: python
      from test_lib_dry_lab.lib.aplace.anotherlongerplace import
   Lookup
      rwo = Lookup('ID222').item[0]
      rwo.get_it_id()
      'AY20'

Environment

tantale commented 3 years ago

Hello,

The formatter function uses textwrap.fill with a width of 70 characters. Currently, this value is hard coded. I need more focus on this issue to find a good way to parametrize this.

Regards.