1 |
pythonhead 08/06/20 18:08:13 |
2 |
|
3 |
Modified: developersguide.xml |
4 |
Log: |
5 |
Removed tabs. |
6 |
|
7 |
Revision Changes Path |
8 |
1.9 xml/htdocs/proj/en/Python/developersguide.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/Python/developersguide.xml?rev=1.9&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/Python/developersguide.xml?rev=1.9&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/Python/developersguide.xml?r1=1.8&r2=1.9 |
13 |
|
14 |
Index: developersguide.xml |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/developersguide.xml,v |
17 |
retrieving revision 1.8 |
18 |
retrieving revision 1.9 |
19 |
diff -u -r1.8 -r1.9 |
20 |
--- developersguide.xml 20 Jun 2008 17:56:35 -0000 1.8 |
21 |
+++ developersguide.xml 20 Jun 2008 18:08:13 -0000 1.9 |
22 |
@@ -1,13 +1,13 @@ |
23 |
<?xml version="1.0" encoding="UTF-8"?> |
24 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
25 |
|
26 |
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/developersguide.xml,v 1.8 2008/06/20 17:56:35 pythonhead Exp $ --> |
27 |
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/developersguide.xml,v 1.9 2008/06/20 18:08:13 pythonhead Exp $ --> |
28 |
|
29 |
<guide link="/proj/en/Python/developersguide.xml" lang="en"> |
30 |
<title>Gentoo Python Developers Guide</title> |
31 |
|
32 |
<author title="Author"> |
33 |
- <mail link="dev-zero@g.o">Tiziano Müller</mail> |
34 |
+ <mail link="dev-zero@g.o">Tiziano MÃŒller</mail> |
35 |
</author> |
36 |
<author title="Author"> |
37 |
<mail link="hawking@g.o">Ali Polatel</mail> |
38 |
@@ -74,7 +74,7 @@ |
39 |
<section> |
40 |
<title>Dropping old versions and Stabilization</title> |
41 |
<body> |
42 |
- |
43 |
+ |
44 |
<p> |
45 |
Every team member should try to keep the package folders clean and uncluttered. |
46 |
Besides the obvious checks (last stable for an arch, last not p.masked, other |
47 |
@@ -108,9 +108,9 @@ |
48 |
|
49 |
<chapter> |
50 |
<title>Correct eclass usage</title> |
51 |
-<section> |
52 |
+<section> |
53 |
<body> |
54 |
- |
55 |
+ |
56 |
<p> |
57 |
There are currently 3 python related eclasses: <b>python</b>, <b>distutils</b> |
58 |
and <b>twisted</b>. |
59 |
@@ -121,7 +121,7 @@ |
60 |
<section> |
61 |
<title>python.eclass</title> |
62 |
<body> |
63 |
- |
64 |
+ |
65 |
<p> |
66 |
Here are some important things to remember when using this eclass: |
67 |
</p> |
68 |
@@ -152,12 +152,12 @@ |
69 |
[...] |
70 |
|
71 |
<stmt>pkg_postinst()</stmt> { |
72 |
- <keyword>python_version</keyword> |
73 |
- <keyword>python_mod_optimize</keyword> /usr/$(get_libdir)/python<var>${PYVER}</var>/site-packages/YOURPACKAGE |
74 |
+ <keyword>python_version</keyword> |
75 |
+ <keyword>python_mod_optimize</keyword> /usr/$(get_libdir)/python<var>${PYVER}</var>/site-packages/YOURPACKAGE |
76 |
} |
77 |
|
78 |
<stmt>pkg_postrm()</stmt> { |
79 |
- <keyword>python_mod_cleanup</keyword> |
80 |
+ <keyword>python_mod_cleanup</keyword> |
81 |
} |
82 |
</pre> |
83 |
|
84 |
@@ -172,7 +172,7 @@ |
85 |
<section> |
86 |
<title>distutils.eclass</title> |
87 |
<body> |
88 |
- |
89 |
+ |
90 |
<ul> |
91 |
<li> |
92 |
To depend on a specific version of python, put NEED_PYTHON=MY_VERSION before |
93 |
@@ -195,7 +195,7 @@ |
94 |
<pre caption="PYTHON_MODNAME usage (example from ipython-0.7.3.ebuild)"> |
95 |
<comment># Copyright 1999-2007 Gentoo Foundation</comment> |
96 |
<comment># Distributed under the terms of the GNU General Public License v2</comment> |
97 |
-<comment># $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/developersguide.xml,v 1.8 2008/06/20 17:56:35 pythonhead Exp $</comment> |
98 |
+<comment># $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/developersguide.xml,v 1.9 2008/06/20 18:08:13 pythonhead Exp $</comment> |
99 |
|
100 |
<ident>NEED_PYTHON</ident>=2.3 |
101 |
|
102 |
@@ -220,9 +220,9 @@ |
103 |
|
104 |
<pre caption="DOCS idiom"> |
105 |
<stmt>src_install()</stmt> { |
106 |
- <ident>DOCS</ident>="foo.txt bar.txt" |
107 |
- <keyword>distutils_src_install</keyword> |
108 |
- <keyword>dohtml</keyword> foo.html bar.png |
109 |
+ <ident>DOCS</ident>="foo.txt bar.txt" |
110 |
+ <keyword>distutils_src_install</keyword> |
111 |
+ <keyword>dohtml</keyword> foo.html bar.png |
112 |
} |
113 |
</pre> |
114 |
|
115 |
@@ -242,7 +242,7 @@ |
116 |
<section> |
117 |
<title>twisted.eclass</title> |
118 |
<body> |
119 |
- |
120 |
+ |
121 |
<p> |
122 |
TBD |
123 |
</p> |
124 |
@@ -255,7 +255,7 @@ |
125 |
<title>Ebuild writing</title> |
126 |
<section> |
127 |
<body> |
128 |
- |
129 |
+ |
130 |
<p> |
131 |
Here are some important things to keep in mind when writing ebuilds for python |
132 |
packages. |
133 |
@@ -266,7 +266,7 @@ |
134 |
<section> |
135 |
<title>Calling python in ebuilds</title> |
136 |
<body> |
137 |
- |
138 |
+ |
139 |
<p> |
140 |
To call python in one of your ebuilds, use "${python}" to do it (defined in |
141 |
distutils.eclass). |
142 |
@@ -277,7 +277,7 @@ |
143 |
<section> |
144 |
<title>Checking for tkinter support</title> |
145 |
<body> |
146 |
- |
147 |
+ |
148 |
<p> |
149 |
To check whether python has tkinter support you can use one of |
150 |
python_tkinter_exists (from python.eclass) or distutils_python_tkinter (from |
151 |
@@ -292,8 +292,8 @@ |
152 |
<title>Common Problems and Mistakes</title> |
153 |
<section> |
154 |
<body> |
155 |
- |
156 |
-<p> |
157 |
+ |
158 |
+<p> |
159 |
Below are common problems you may face and common mistakes made when writing |
160 |
ebuilds for python packages. |
161 |
</p> |
162 |
@@ -303,7 +303,7 @@ |
163 |
<section> |
164 |
<title>setuptools: *_require and use_setuptools()</title> |
165 |
<body> |
166 |
- |
167 |
+ |
168 |
<impo> |
169 |
For setuptools-0.6a9 and newer you no longer have to remove _require options |
170 |
other than tests_require because starting with this version |
171 |
@@ -370,12 +370,12 @@ |
172 |
|
173 |
<pre caption="myghty-1.1.ebuild"> |
174 |
<stmt>src_unpack</stmt>() { |
175 |
- <keyword>unpack</keyword> <var>${A}</var> |
176 |
- <keyword>cd</keyword> "<var>${S}</var>" |
177 |
- <keyword>sed</keyword> -i \ |
178 |
- -e '/use_setuptools/d' \ |
179 |
- -e '/install_requires=\[.*\],/d' \ |
180 |
- setup.py || <keyword>die</keyword> "sed failed" |
181 |
+ <keyword>unpack</keyword> <var>${A}</var> |
182 |
+ <keyword>cd</keyword> "<var>${S}</var>" |
183 |
+ <keyword>sed</keyword> -i \ |
184 |
+ -e '/use_setuptools/d' \ |
185 |
+ -e '/install_requires=\[.*\],/d' \ |
186 |
+ setup.py || <keyword>die</keyword> "sed failed" |
187 |
} |
188 |
</pre> |
189 |
|
190 |
@@ -384,7 +384,7 @@ |
191 |
<section> |
192 |
<title>src_test and PYTHONPATH</title> |
193 |
<body> |
194 |
- |
195 |
+ |
196 |
<p> |
197 |
When testing python packages it's important to make sure we're actually testing |
198 |
the package that is going to be merged not the already installed package. We can |
199 |
@@ -394,13 +394,13 @@ |
200 |
|
201 |
<pre caption="src_test of dev-python/mechanize-0.1.7b -- a pure python module"> |
202 |
<stmt>src_test()</stmt> { |
203 |
- <ident>PYTHONPATH</ident>=build/lib/ "<var>${python}</var>" test.py || <keyword>die</keyword> "tests failed" |
204 |
+ <ident>PYTHONPATH</ident>=build/lib/ "<var>${python}</var>" test.py || <keyword>die</keyword> "tests failed" |
205 |
} |
206 |
</pre> |
207 |
|
208 |
<pre caption="src_test of dev-python/pyme-0.6.0-r1 -- a python module written in C"> |
209 |
<stmt>src_test()</stmt> { |
210 |
- <ident>PYTHONPATH</ident>="<var>$(ls -d build/lib.*)</var>" "<var>${python}</var>" examples/genkey.py || <keyword>die</keyword> "genkey test failed" |
211 |
+ <ident>PYTHONPATH</ident>="<var>$(ls -d build/lib.*)</var>" "<var>${python}</var>" examples/genkey.py || <keyword>die</keyword> "genkey test failed" |
212 |
} |
213 |
</pre> |
214 |
|
215 |
@@ -415,10 +415,10 @@ |
216 |
<section> |
217 |
<title>Is dev-python/setuptools an RDEPEND or DEPEND?</title> |
218 |
<body> |
219 |
- |
220 |
- <p>repoman may issue a warning saying dev-python/setuptools is a suspicious RDEPEND. Note however that setuptools is quite often a run-time dependency by code that installs commands in /usr/bin, uses pkg_resources to require specific package versions or makes use of entry points in a plugin system. |
221 |
+ |
222 |
+ <p>repoman may issue a warning saying <c>dev-python/setuptools</c> is a suspicious RDEPEND. Note however that <c>setuptools</c> is quite often a run-time dependency by code that installs commands in /usr/bin, uses pkg_resources to require specific package versions or makes use of entry points in a plugin system. |
223 |
</p> |
224 |
-<p>If you emerge a package that uses setuptools and it installs commands in /usr/bin you can look at those commands and easily determine if setuptools is required at run-time. |
225 |
+<p>If you emerge a package that uses <c>setuptools</c> and it installs commands in /usr/bin you can look at those commands and easily determine if <c>setuptools</c> is required at run-time. |
226 |
</p> |
227 |
|
228 |
<pre caption="Example of code that requires setuptools at run-time"> |
229 |
@@ -428,14 +428,14 @@ |
230 |
<stmt>import sys</stmt> |
231 |
<stmt>from pkg_resources import load_entry_point</stmt> |
232 |
</pre> |
233 |
-<p>If the script imports 'pkg_resources' then dev-python/setuptools must be in RDEPEND. |
234 |
+<p>If the script imports <b>pkg_resources</b> then <c>dev-python/setuptools</c> must be in RDEPEND. |
235 |
</p> |
236 |
-<p>You can also use dev-python/yolk to see if a package uses setuptools entry points by giving it the Python <b>module</b> name (not Gentoo package name). |
237 |
+<p>You can also use <c>dev-python/yolk</c> to determine if a package uses <c>setuptools</c> entry points by giving it the Python <b>module</b> name (not Gentoo package name). |
238 |
</p> |
239 |
<pre caption="Example of a Python module that requires setuptools at run-time"> |
240 |
<stmt>$ yolk --entry-map paste</stmt> |
241 |
</pre> |
242 |
-<p>If there is any output, then dev-python/setuptools should be in RDEPEND. |
243 |
+<p>If there is any output, then <c>dev-python/setuptools</c> should be in RDEPEND. |
244 |
</p> |
245 |
</body> |
246 |
</section> |
247 |
|
248 |
|
249 |
|
250 |
-- |
251 |
gentoo-commits@l.g.o mailing list |