Table of Contents
Abstract
This reference lists all the variables that are used within the “cpython” tool, and the available builders. It is intended for SCons tool developers and core programmers, as a normal user you should read the manual instead.
Internally, the builder is based on the
Install
/InstallAs
methods from
SCons.Tool.install
. It makes use of the basic builder's
functions: installFunc()
, and
add_targets_to_INSTALLED_FILES()
.
The “InstallPython
” method creates
.pyc
or .pyo
files for
.py
source files and adds them to the list of targets
along with the source files. They are later copied to the destination
(target) directory.
Example:
env = Environment() hello = File('hello.py') env.InstallPython('/usr/local/bin/', hello) env.Alias('install', '/usr/local/bin/')
Default value is 1
, which means that the
Python source files get compiled to .pyc
files.
Set this variable to 0
in order to get
optimized .pyo
files, parallel to your
installed sources.
The path to the external Python executable, used for
creating optimized .pyo
files. Default value is
'python
'.
Additional flags for compiling optimized Python files
(.pyo
). The default is
'-O
'.
The command arguments for compiling optimized Python files
(.pyo
). The default value is '-c
'import sys,py_compile; [py_compile.compile(i) for i in
sys.argv[1:]]'
'.
The command line for compiling optimized Python files
(.pyo
). Default is '$CPYTHON_EXE
$CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD
'.
The message string for the
'CPYTHON_PYCOM
' command. Default is
'Install file: "$SOURCE" as "$TARGET"
'.
Default value is '.py'. The suffix for Python source files.