Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2008-03-06 01:06:18


Author: vladimir_prus
Date: 2008-03-06 01:06:17 EST (Thu, 06 Mar 2008)
New Revision: 43526
URL: http://svn.boost.org/trac/boost/changeset/43526

Log:
Add 'pythonpath' feature to specify additional PYTHONPATH elements.
Make bpl-test correctly set dependencies if used with multiple .pyd
sources.

Patch from Joshua Napoli.

Text files modified:
   trunk/tools/build/v2/tools/python.jam | 18 ++++++++++++++++--
   1 files changed, 16 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/tools/python.jam
==============================================================================
--- trunk/tools/build/v2/tools/python.jam (original)
+++ trunk/tools/build/v2/tools/python.jam 2008-03-06 01:06:17 EST (Thu, 06 Mar 2008)
@@ -111,6 +111,12 @@
 
     configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
 
+ # The pythonpath feature specifies additional elements for the PYTHONPATH
+ # environment variable, set by run-pyd. For example, pythonpath can be used
+ # to access Python modules that are part of the product being built, but
+ # are not installed in the development system's default paths.
+ feature.feature pythonpath : : free optional path ;
+
     project.pop-current ;
 }
 
@@ -1148,6 +1154,13 @@
     return $(x[1]) ;
 }
 
+# Extract the path to a single ".pyd" source. This is used to build the
+# PYTHONPATH for running bpl tests.
+local rule pyd-pythonpath ( source )
+{
+ return [ on $(source) return $(LOCATE) $(SEARCH) ] ;
+}
+
 # The flag settings on testing.capture-output do not
 # apply to python.capture output at the moment.
 # Redo this explicitly.
@@ -1161,8 +1174,9 @@
     # over explicitly.
     RUN_PATH on $(sources[1]) = [ on $(sources[2-]) return $(RUN_PATH) ] ;
 
- PYTHONPATH = [ on $(sources[2-]) return $(LOCATE) $(SEARCH) ] ;
-
+ PYTHONPATH = [ sequence.transform pyd-pythonpath : $(sources[2-]) ] ;
+ PYTHONPATH += [ feature.get-values pythonpath : $(properties) ] ;
+
     # After test is run, we remove the Python module, but not the Python
     # script.
     testing.capture-output $(target) : $(sources[1]) : $(properties)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk