Ravenports generated: 02 Mar 2023 03:43
[ravenports.git] / bucket_71 / python-Deprecated
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-Deprecated
4 VERSION=                1.2.13
5 KEYWORDS=               python
6 VARIANTS=               py310 v11
7 SDESC[py310]=           Implements @deprecated decorator (3.10)
8 SDESC[v11]=             Implements @deprecated decorator (3.11)
9 HOMEPAGE=               https://github.com/tantale/deprecated
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/51/6a/c3a0408646408f7283b7bc550c30a32cc791181ec4618592eec13e066ce3
14 DISTFILE[1]=            Deprecated-1.2.13-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py310]=           single
17 SPKGS[v11]=             single
18
19 OPTIONS_AVAILABLE=      PY310 PY311
20 OPTIONS_STANDARD=       none
21 VOPTS[py310]=           PY310=ON PY311=OFF
22 VOPTS[v11]=             PY310=OFF PY311=ON
23
24 DISTNAME=               Deprecated-1.2.13.dist-info
25
26 GENERATED=              yes
27
28 [PY310].RUN_DEPENDS_ON=                 python-wrapt:single:py310
29 [PY310].USES_ON=                        python:py310,wheel
30
31 [PY311].RUN_DEPENDS_ON=                 python-wrapt:single:v11
32 [PY311].USES_ON=                        python:v11,wheel
33
34 [FILE:2455:descriptions/desc.single]
35
36 Deprecated Library
37 ------------------
38
39 Deprecated is Easy to Use
40 `
41
42 If you need to mark a function or a method as deprecated,
43 you can use the ``@deprecated`` decorator:
44
45 Save in a hello.py:
46
47 .. code:: python
48
49     from deprecated import deprecated
50
51     @deprecated(version='1.2.1', reason="You should use another function")
52     def some_old_function(x, y):
53         return x + y
54
55     class SomeClass(object):
56         @deprecated(version='1.3.0', reason="This method is deprecated")
57         def some_old_method(self, x, y):
58             return x + y
59
60     some_old_function(12, 34)
61     obj = SomeClass()
62     obj.some_old_method(5, 8)
63
64 And Easy to Setup
65 `
66
67 And run it:
68
69 .. code:: bash
70
71     $ pip install Deprecated
72     $ python hello.py
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
78 some_old_method.
79     (This method is deprecated) -- Deprecated since version 1.3.0.
80       obj.some_old_method(5, 8)
81
82 You can document your code
83 ``
84
85 Have you ever wonder how to document that some functions, classes, methods,
86 etc. are deprecated?
87 This is now possible with the integrated Sphinx directives:
88
89 For instance, in hello_sphinx.py:
90
91 .. code:: python
92
93     from deprecated.sphinx import deprecated
94     from deprecated.sphinx import versionadded
95     from deprecated.sphinx import versionchanged
96
97     @versionadded(version='1.0', reason="This function is new")
98     def function_one():
99         '''This is the function one'''
100
101     @versionchanged(version='1.0', reason="This function is modified")
102     def function_two():
103         '''This is the function two'''
104
105     @deprecated(version='1.0', reason="This function will be removed soon")
106     def function_three():
107         '''This is the function three'''
108
109     function_one()
110     function_two()
111     function_three()  # warns
112
113     help(function_one)
114     help(function_two)
115     help(function_three)
116
117 The result it immediate
118 ```
119
120 Run it:
121
122 .. code:: bash
123
124     $ python hello_sphinx.py
125
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
130
131     Help on function function_one in module __main__:
132
133     function_one()
134         This is the function one
135
136
137 [FILE:117:distinfo]
138 64756e3e14c8c5eea9795d93c524551432a0be75629f8f29e67ab8caf076c76d         9551 Deprecated-1.2.13-py2.py3-none-any.whl
139