root/branches/mk/README

Revision 117, 9.4 kB (checked in by mk, 7 years ago)

More README updates.

Line 
1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 Cheesecake: How tasty is your code?
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 .. contents:: **Table of Contents**
6
7 Summary
8 -------
9
10 The idea of the Cheesecake project is to rank Python packages based on various
11 empirical "kwalitee" factors, such as:
12
13  * whether the package can be downloaded from PyPI given its name
14  * whether the package can be unpacked
15  * whether the package can be installed into an alternate directory
16  * existence of certain files such as README, INSTALL, LICENSE, setup.py etc.
17  * percentage of modules/functions/classes/methods with docstrings
18  * ... and many others
19
20 Currently, the Cheesecake index is computed for invidual packages obtained
21 through a variety of methods (detailed below). One of the goals of the
22 Cheesecake project is to automatically compute the Cheesecake index for
23 all packages uploaded to the PyPI Cheese Shop (possibly at upload time) and
24 to maintain a collection of Web pages with statistics related to the
25 various indexes of the packages.
26
27 Cheesecake currently computes 3 types of indexes:
28
29  * installability index
30  * documentation index
31  * code kwalitee index
32
33 The algorithms for computing each index type are detailed below.
34
35 Why Cheesecake?
36 ---------------
37
38 The concept of "kwalitee" originated in the Perl community. Here's a relevant
39 quote:
40
41   *It looks like quality, it sounds like quality, but it's not quite quality.*
42
43 Kwalitee is an empiric measure of how good a specific body of code is. It
44 defines quality indicators and measures the code along them. It is currently
45 used by the `CPANTS Testing Service <http://cpants.dev.zsi.at/index.html>`_
46 to evaluate the 'goodness' of CPAN packages.
47
48 Since the Python package repository (aka `PyPI <http://www.python.org/pypi>`_)
49 is hosted at the Cheese Shop,
50 it stands to reason that the quality indicator of a PyPI package should be
51 called the Cheesecake index!
52
53 Requirements
54 ------------
55
56 * `pylint <http://www.logilab.org/projects/pylint>`_ is required for
57   part of the code kwalitee index computation
58 * `setuptools <http://peak.telecommunity.com/DevCenter/setuptools>`_ is
59   required for testing installation
60
61 Usage examples
62 --------------
63
64 To compute the Cheesecake index for a given project, run the cheesecake.py
65 module from the command line and indicate either:
66
67  * the package short name (e.g. twill) or
68  * the package URL (e.g. http://darcs.idyll.org/~t/projects/twill-0.7.4.tar.gz) or
69  * the package path on the file system (e.g. /tmp/twill-latest.tar.gz)
70
71 In all cases, the cheesecake module will attempt to download the package
72 if necessary, then to unpack it in a sandbox directory (/tmp/cheesecake_sandbox
73 by default). If either of these operations fails, the Cheesecake index for
74 the package will be 0. If the package can be successfully unpacked, the
75 cheesecake module will compute the values for a variety of indexes detailed
76 in the algorithm given at the end of this file.
77
78 If the package can be successfully downloaded and unpacked, a log file is
79 created in the system /tmp directory and named <package>.log (e.g. the log file
80 for twill-0.7.4.tar.gz is /tmp/twill-0.7.4.tar.gz.log).
81 The log file is automatically deleted after the Cheesecake index is
82 computed, except for situations when error has occured.
83
84 Command-line examples:
85
86  1. Compute the Cheesecake index for the Durus package by using setuptools
87     utilities to download the package from PyPI::
88
89       python cheesecake.py --name=Durus
90
91  2. Compute the Cheesecake index for the Durus package by indicating its URL::
92
93       python cheesecake.py --url=http://www.mems-exchange.org/software/durus/Durus-3.1.tar.gz
94
95  3. Compute the Cheesecake index for the twill package by indicating its path
96     on the local file system::
97
98       python cheesecake.py --path=/tmp/twill-latest.tar.gz
99
100  4. To increase the verbosity of the output, use the -v or --verbose option.
101     For more options, run cheesecake.py with -h or --help.
102
103 Obtaining the source code
104 -------------------------
105
106 You can get the source code via svn::
107
108   svn co http://svn.pycheesecake.org/trunk cheesecake
109
110 *Note*: make sure you indicate the target directory when you do the svn checkout,
111 otherwise the cheesecake package files will be checked out directly in your
112 current directory.
113
114 The source code is also available with [http://pycheesecake.org/browser browsing]
115 on project's Trac wiki.
116
117 You may want to modify your subversion client configuration to automatically
118 expand tags, like $Id$, $Author$ etc. To do so add following two lines to your
119 ``/.subversion/config``::
120
121   enable-auto-props = yes
122
123 in [miscellany] section, and::
124
125   *.py = svn:eol-style=native;svn:keywords=Author Date Id Revision
126
127 in [auto-props] section.
128
129 Buildbot
130 --------
131
132 A buildbot is happily running svn updates and unit tests. Check it out
133 `here <http://agilistas.org:8888/>`_.
134
135 Mailing list
136 ------------
137
138 Developer mailing list: http://lists.sourceforge.net/lists/listinfo/cheesecake-devel
139
140 License
141 -------
142
143 Cheesecake is licensed under the Python Software Foundation license,
144 the same license that governs Python itself. The text of the license is
145 available in the ``LICENSE`` file in the source code distribution and
146 can also be downloaded from
147 http://www.opensource.org/licenses/PythonSoftFoundation.php.
148
149 Authors contact info
150 --------------------
151
152 Grig Gheorghiu
153
154 :Email: <grig at gheorghiu dot net>
155 :Web site: http://agiletesting.blogspot.com
156
157 Michal Kwiatkowski
158
159 :Email: <ruby at joker.linuxstuff.pl>
160 :Web site: http://joker.linuxstuff.pl
161
162 Note: clipart for the cheesecake slice logo used with permission from
163 Kazumi Hatasa, Director, the Japanese School at Middlebury College,
164 Purdue University.
165
166 Algorithm for computing the Cheesecake index
167 --------------------------------------------
168
169 Overall Cheesecke score is a sum of values of 3 main indexes
170 (installability, documentation and code kwalitee). Values of these
171 indexes rely on values of their subindexes and so on. Whole index tree
172 and corresponding values for each leaf is presented below:
173
174 * Installability
175
176   * package is listed on and can be downloaded from PyPI: 50
177   * package can be downloaded from given URL: 25
178   * package can be unpacked without problems: 25
179   * unpacked package directory is the same as package name: 15
180   * package has setup.py: 25
181   * package can be installed to given directory via "setup.py install": 50
182   * package contain generated files, like .pyc: -20
183
184 * Documentation
185
186   * package contain files listed below
187
188     * README: 30
189     * LICENCE/COPYING: 30
190     * ANNOUNCE/CHANGELOG: 20
191     * INSTALL: 20
192     * AUTHORS: 10
193     * FAQ: 10
194     * NEWS: 10
195     * THANKS: 10
196     * TODO: 10
197
198   * package contain directories listed below
199
200     * doc/docs: 30
201     * test/tests: 30
202     * demo/example/examples: 10
203
204   * code is documented by docstrings: 100
205   * docstrings have proper formatting (like epytext or reST): 30
206
207 * Code Kwalitee
208
209   * package has high pylint score: 50
210   * package uses at least one of known unit test frameworks: 30
211
212 Final score depends on how well package scores for all indexes
213 listed above. Score is presented in absolute range (number of points)
214 and relative (percent of gathered points compared to maximum).
215
216 Sample output
217 -------------
218
219 ::
220
221     $ python cheesecake_index -n Durus
222     py_pi_download .........................  50  (downloaded package Durus-3.4.1.tar.gz following 1 link from http://www.mems-exchange.org/software/durus/Durus-3.4.1.tar.gz)
223     unpack .................................  25  (package unpacked successfully)
224     unpack_dir .............................  15  (unpack directory is Durus-3.4.1 as expected)
225     setup.py ...............................  25  (setup.py found)
226     install ................................  50  (package installed in /tmp/cheesecakebJ2JTZ/tmp_install_Durus-3.4.1)
227     generated_files ........................   0  (0 .pyc and 0 .pyo files found)
228     ---------------------------------------------
229     INSTALLABILITY INDEX (ABSOLUTE) ........ 165
230     INSTALLABILITY INDEX (RELATIVE) ........ 100  (165 out of a maximum of 165 points is 100%)
231    
232     required_files ......................... 150  (4 files and 2 required directories found)
233     docstrings .............................  33  (found 121/369=32.79% objects with docstrings)
234     formatted_docstrings ...................   0  (found 6/369=1.63% objects with formatted docstrings)
235     ---------------------------------------------
236     DOCUMENTATION INDEX (ABSOLUTE) ......... 183
237     DOCUMENTATION INDEX (RELATIVE) .........  53  (183 out of a maximum of 350 points is 53%)
238    
239     pylint .................................  33  (pylint score was 6.59 out of 10)
240     use_test_framework .....................  30  (use one or more of known test frameworks)
241     ---------------------------------------------
242     CODE KWALITEE INDEX (ABSOLUTE) .........  63
243     CODE KWALITEE INDEX (RELATIVE) .........  79  (63 out of a maximum of 80 points is 79%)
244    
245    
246     =============================================
247     OVERALL CHEESECAKE INDEX (ABSOLUTE) .... 411
248     OVERALL CHEESECAKE INDEX (RELATIVE) ....  69  (411 out of a maximum of 595 points is 69%)
249    
250 Future plans
251 ------------
252 Cheesecake is under very active development. The immediate goal is to add the unit test
253 index measurement, followed by other metrics inspired from the
254 `kwalitee indicators <http://cpants.dev.zsi.at/kwalitee.html>`_.
255 Please edit the `IndexMeasurementIdeas <http://pycheesecake.org/wiki/IndexMeasurementIdeas>`_
256 Wiki page to add things that you would like to see covered
257 by the Cheesecake metrics.
258
259 .. footer:: Last modified 2006-07-30 by `Michal Kwiatkowski <http://joker.linuxstuff.pl>`_.
Note: See TracBrowser for help on using the browser.