nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

Add "deprecated" functions, enums, enum values, attributes to nimi-python's code generator

Open marcoskirsch opened this issue 5 years ago • 2 comments

Description of issue

We need the ability to mark functions as "deprecated" in metadata so that the codegenerator does the appropriate thing:

  • DeprecationWarning
  • remove from ReadTheDocs or mark it as deprecated

This is needed for #1403

marcoskirsch avatar Apr 14 '21 20:04 marcoskirsch

We should have the ability to deprecate enums, enum values and attributes, as well.

ni-jfitzger avatar Jan 08 '25 19:01 ni-jfitzger

In https://github.com/ni/nidaqmx-python and https://github.com/ni/measurement-plugin-python we have been using the https://pypi.org/project/deprecation/ package, which provides a decorator that generates a warning and adds a deprecated notice to the docstring.

However, Python 3.13 adds a standard decorator for this, @warnings.deprecated, so I will not be using the deprecation package in new code. I will use the backport in https://github.com/python/typing_extensions/

Also, the docstring manipulation done by the deprecation package only works with doc tools that load your code at runtime, like autodoc, not doc tools that parse your code without loading it, like sphinx-autoapi.

bkeryan avatar May 12 '25 21:05 bkeryan