Ravenports generated: 02 Apr 2023 18:43
[ravenports.git] / bucket_8D / python-decorator
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-decorator
4 VERSION=                5.1.1
5 KEYWORDS=               python
6 VARIANTS=               py310 v11
7 SDESC[py310]=           Decorators for Humans (3.10)
8 SDESC[v11]=             Decorators for Humans (3.11)
9 HOMEPAGE=               https://github.com/micheles/decorator
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6
14 DISTFILE[1]=            decorator-5.1.1-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=               decorator-5.1.1.dist-info
25
26 GENERATED=              yes
27
28 [PY310].USES_ON=                        python:py310,wheel
29
30 [PY311].USES_ON=                        python:v11,wheel
31
32 [FILE:2905:descriptions/desc.single]
33 Decorators for Humans
34 =====================
35
36 The goal of the decorator module is to make it easy to define
37 signature-preserving function decorators and decorator factories.
38 It also includes an implementation of multiple dispatch and other niceties
39 (please check the docs). It is released under a two-clauses
40 BSD license, i.e. basically you can do whatever you want with it but I am
41 not
42 responsible.
43
44 Installation
45 -------------
46
47 If you are lazy, just perform
48
49  ``$ pip install decorator``
50
51 which will install just the module on your system.
52
53 If you prefer to install the full distribution from source, including
54 the documentation, clone the `GitHub repo`_ or download the tarball_,
55 unpack it and run
56
57  ``$ pip install .``
58
59 in the main directory, possibly as superuser.
60
61 .. _tarball: https://pypi.org/project/decorator/#files
62 .. _GitHub repo: https://github.com/micheles/decorator
63
64 Testing
65 --------
66
67 If you have the source code installation you can run the tests with
68
69  `$ python src/tests/test.py -v`
70
71 or (if you have setuptools installed)
72
73  `$ python setup.py test`
74
75 Notice that you may run into trouble if in your system there
76 is an older version of the decorator module; in such a case remove the
77 old version. It is safe even to copy the module `decorator.py` over
78 an existing one, since we kept backward-compatibility for a long time.
79
80 Repository
81 ---------------
82
83 The project is hosted on GitHub. You can look at the source here:
84
85  https://github.com/micheles/decorator
86
87 Documentation
88 ---------------
89
90 The documentation has been moved to
91 https://github.com/micheles/decorator/blob/master/docs/documentation.md
92
93 From there you can get a PDF version by simply using the print
94 functionality of your browser.
95
96 Here is the documentation for previous versions of the module:
97
98 https://github.com/micheles/decorator/blob/4.3.2/docs/tests.documentation.rst
99 https://github.com/micheles/decorator/blob/4.2.1/docs/tests.documentation.rst
100 https://github.com/micheles/decorator/blob/4.1.2/docs/tests.documentation.rst
101 https://github.com/micheles/decorator/blob/4.0.0/documentation.rst
102 https://github.com/micheles/decorator/blob/3.4.2/documentation.rst
103
104 For the impatient
105 -----------------
106
107 Here is an example of how to define a family of decorators tracing slow
108 operations:
109
110 .. code-block:: python
111
112    from decorator import decorator
113
114    @decorator
115    def warn_slow(func, timelimit=60, *args, **kw):
116        t0 = time.time()
117        result = func(*args, **kw)
118        dt = time.time() - t0
119        if dt > timelimit:
120            logging.warn('%s took %d seconds', func.__name__, dt)
121        else:
122            logging.info('%s took %d seconds', func.__name__, dt)
123        return result
124
125    @warn_slow  # warn if it takes more than 1 minute
126    def preprocess_input_files(inputdir, tempdir):
127        ...
128
129    @warn_slow(timelimit=600)  # warn if it takes more than 10 minutes
130    def run_calculation(tempdir, outdir):
131        ...
132
133
134
135 [FILE:111:distinfo]
136 b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186         9073 decorator-5.1.1-py3-none-any.whl
137