1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-Deprecated
7 SDESC[py310]= Implements @deprecated decorator (3.10)
8 SDESC[py39]= Implements @deprecated decorator (3.9)
9 HOMEPAGE= https://github.com/tantale/deprecated
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/51/6a/c3a0408646408f7283b7bc550c30a32cc791181ec4618592eec13e066ce3
14 DISTFILE[1]= Deprecated-1.2.13-py2.py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY39 PY310
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY39=OFF PY310=ON
22 VOPTS[py39]= PY39=ON PY310=OFF
24 DISTNAME= Deprecated-1.2.13.dist-info
28 [PY39].RUN_DEPENDS_ON= python-wrapt:single:py39
29 [PY39].USES_ON= python:py39,wheel
31 [PY310].RUN_DEPENDS_ON= python-wrapt:single:py310
32 [PY310].USES_ON= python:py310,wheel
34 [FILE:2455:descriptions/desc.single]
39 Deprecated is Easy to Use
42 If you need to mark a function or a method as deprecated,
43 you can use the ``@deprecated`` decorator:
49 from deprecated import deprecated
51 @deprecated(version='1.2.1', reason="You should use another function")
52 def some_old_function(x, y):
55 class SomeClass(object):
56 @deprecated(version='1.3.0', reason="This method is deprecated")
57 def some_old_method(self, x, y):
60 some_old_function(12, 34)
62 obj.some_old_method(5, 8)
71 $ pip install Deprecated
73 hello.py:15: DeprecationWarning: Call to deprecated function (or
74 staticmethod) some_old_function.
75 (You should use another function) -- Deprecated since version 1.2.0.
76 some_old_function(12, 34)
77 hello.py:17: DeprecationWarning: Call to deprecated method
79 (This method is deprecated) -- Deprecated since version 1.3.0.
80 obj.some_old_method(5, 8)
82 You can document your code
85 Have you ever wonder how to document that some functions, classes, methods,
87 This is now possible with the integrated Sphinx directives:
89 For instance, in hello_sphinx.py:
93 from deprecated.sphinx import deprecated
94 from deprecated.sphinx import versionadded
95 from deprecated.sphinx import versionchanged
97 @versionadded(version='1.0', reason="This function is new")
99 '''This is the function one'''
101 @versionchanged(version='1.0', reason="This function is modified")
103 '''This is the function two'''
105 @deprecated(version='1.0', reason="This function will be removed soon")
106 def function_three():
107 '''This is the function three'''
111 function_three() # warns
117 The result it immediate
124 $ python hello_sphinx.py
126 hello_sphinx.py:23: DeprecationWarning: Call to deprecated function (or
127 staticmethod) function_three.
128 (This function will be removed soon) -- Deprecated since version 1.0.
129 function_three() # warns
131 Help on function function_one in module __main__:
134 This is the function one
138 64756e3e14c8c5eea9795d93c524551432a0be75629f8f29e67ab8caf076c76d 9551 Deprecated-1.2.13-py2.py3-none-any.whl