public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michal Gorny (mgorny)" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/en/Python/python-r1: dev-guide.xml
Date: Mon, 26 Nov 2012 12:14:31 +0000 (UTC)	[thread overview]
Message-ID: <20121126121431.8DB7120C65@flycatcher.gentoo.org> (raw)

mgorny      12/11/26 12:14:31

  Modified:             dev-guide.xml
  Log:
  Mention python_optimize, a bit of clean up.

Revision  Changes    Path
1.3                  xml/htdocs/proj/en/Python/python-r1/dev-guide.xml

file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml?r1=1.2&r2=1.3

Index: dev-guide.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dev-guide.xml	24 Nov 2012 21:34:34 -0000	1.2
+++ dev-guide.xml	26 Nov 2012 12:14:31 -0000	1.3
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
 
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml,v 1.2 2012/11/24 21:34:34 mgorny Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/Python/python-r1/dev-guide.xml,v 1.3 2012/11/26 12:14:31 mgorny Exp $ -->
 
 <guide lang="en">
 <title>python-r1 Developer's Guide</title>
@@ -23,8 +23,8 @@
 <!-- See http://creativecommons.org/licenses/by-sa/3.0/ -->
 <license version="3.0"/>
 
-<version>2</version>
-<date>2012-11-24</date>
+<version>3</version>
+<date>2012-11-26</date>
 
 <chapter id="Introductory_info">
 	<title>Introductory information</title>
@@ -568,7 +568,7 @@
 				The in-source builds are implemented for packages where
 				out-of-source builds are problematic. They are enabled either
 				explicitly when the <c>DISTUTILS_IN_SOURCE_BUILD</c> variable
-				is set (to any value) or implicitly
+				is set (to any value), or implicitly
 				when the <c>python_prepare</c> sub-phase is declared.
 			</p>
 
@@ -577,10 +577,11 @@
 				<c>python_prepare_all</c> first creates a copy of all
 				the sources in the <c>BUILD_DIR</c> for each implementation.
 				The implementation-common sub-phase functions are still executed
-				in the source directory but the implementation-specific ones
-				are executed in the build directory for each implementation.
-				There is no explicit linking between the source copies,
-				therefore the build system is allowed to modify them freely.
+				in the source directory, but those
+				of the implementation-specific sub-phases are executed in build
+				directories. There is no explicit linking between the source
+				copies, therefore the build system is allowed to modify them
+				freely.
 			</p>
 		</body>
 	</section>
@@ -889,7 +890,47 @@
 	<keyword>python_foreach_impl python_doscript</keyword> myscript
 }
 </pre>
+		</body>
+	</section>
+
+	<section id="pur1_Compiling_installed_Python_modules">
+		<title>Compiling installed Python modules</title>
 
+		<body>
+			<p>
+				There are a few packages which are able to install the Python
+				modules correctly but either do not compile them at all, or fail
+				to do it properly. For those packages, <c>python_optimize</c>
+				is the tool of choice.
+			</p>
+
+			<p>
+				The <c>python_optimize</c> function takes an optional list
+				of directory paths. If the list is provided, it compiles
+				all Python modules in the directories listed. Otherwise,
+				it compiles the modules installed into the standard module
+				install locations, including the <path>site-packages</path>
+				directory.
+			</p>
+
+			<p>
+				The modules are compiled using the current Python implementation
+				(<c>EPYTHON</c>).
+			</p>
+
+			<pre caption='Compiling Python modules'>
+src_install() {
+	<keyword>python_export</keyword> <const>python2_7</const> <var>EPYTHON PYTHON</var>
+
+	<comment># Compile modules in custom location using python2.7</comment>
+	<comment># (note: you can not rely on ${PYTHONPATH})</comment>
+	<keyword>python_optimize</keyword> "${D}"/usr/lib/portage/pym
+
+	<comment># Compile modules installed to site-packages</comment>
+	<comment># for all enabled implementations</comment>
+	<keyword>python_foreach_impl python_optimize</keyword>
+}
+</pre>
 		</body>
 	</section>
 </chapter>





             reply	other threads:[~2012-11-26 12:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 12:14 Michal Gorny (mgorny) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-20 21:15 [gentoo-commits] gentoo commit in xml/htdocs/proj/en/Python/python-r1: dev-guide.xml Michal Gorny (mgorny)
2013-06-27  2:09 Robin H. Johnson (robbat2)
2013-02-15 14:35 Michal Gorny (mgorny)
2013-02-13 11:40 Michal Gorny (mgorny)
2013-01-30 11:30 Michal Gorny (mgorny)
2013-01-12 23:34 Michal Gorny (mgorny)
2013-01-11 21:16 Michal Gorny (mgorny)
2013-01-04 22:34 Michal Gorny (mgorny)
2012-12-09 14:39 Michal Gorny (mgorny)
2012-12-07 18:00 Michal Gorny (mgorny)
2012-12-06 16:15 Michal Gorny (mgorny)
2012-12-01  9:27 Michal Gorny (mgorny)
2012-11-30 11:04 Michal Gorny (mgorny)
2012-11-28 19:49 Michal Gorny (mgorny)
2012-11-27 20:41 Michal Gorny (mgorny)
2012-11-27 17:47 Michal Gorny (mgorny)
2012-11-24 21:34 Michal Gorny (mgorny)
2012-11-10  8:26 Michal Gorny (mgorny)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121126121431.8DB7120C65@flycatcher.gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox