Ravenports generated: 30 May 2020 18:50
[ravenports.git] / bucket_8D / python-decorator
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-decorator
4 VERSION=                4.4.2
5 KEYWORDS=               python
6 VARIANTS=               py38 py37
7 SDESC[py37]=            Decorators for Humans (PY37)
8 SDESC[py38]=            Decorators for Humans (PY38)
9 HOMEPAGE=               https://github.com/micheles/decorator
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/d/decorator
14 DISTFILE[1]=            decorator-4.4.2.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[py37]=            single
17 SPKGS[py38]=            single
18
19 OPTIONS_AVAILABLE=      PY38 PY37
20 OPTIONS_STANDARD=       none
21 VOPTS[py37]=            PY38=OFF PY37=ON
22 VOPTS[py38]=            PY38=ON PY37=OFF
23
24 DISTNAME=               decorator-4.4.2
25
26 GENERATED=              yes
27
28 [PY37].USES_ON=                         python:py37
29
30 [PY38].USES_ON=                         python:py38
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:101:distinfo]
136 e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7        33629 decorator-4.4.2.tar.gz
137