File: extension.py

package info (click to toggle)
cython 0.15.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,480 kB
  • sloc: python: 45,354; xml: 1,031; cpp: 635; makefile: 229; lisp: 48; ansic: 28
file content (96 lines) | stat: -rw-r--r-- 3,309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
"""Pyrex.Distutils.extension

Provides a modified Extension class, that understands how to describe
Pyrex extension modules in setup scripts."""

__revision__ = "$Id:$"

import os
import sys
from types import *
import distutils.extension as _Extension

try:
    import warnings
except ImportError:
    warnings = None

class Extension(_Extension.Extension):
    _Extension.Extension.__doc__ + \
    """pyrex_include_dirs : [string]
        list of directories to search for Pyrex header files (.pxd) (in
        Unix form for portability)
    pyrex_directives : {string:value}
        dict of compiler directives
    pyrex_create_listing_file : boolean
        write pyrex error messages to a listing (.lis) file.
    pyrex_line_directives : boolean
        emit pyx line numbers for debugging/profiling
    pyrex_cplus : boolean
        use the C++ compiler for compiling and linking.
    pyrex_c_in_temp : boolean
        put generated C files in temp directory.
    pyrex_gen_pxi : boolean
        generate .pxi file for public declarations
    pyrex_gdb : boolean
        generate Cython debug information for this extension for cygdb
    no_c_in_traceback : boolean
        emit the c file and line number from the traceback for exceptions
    """

    # When adding arguments to this constructor, be sure to update
    # user_options.extend in build_ext.py.
    def __init__ (self, name, sources,
            include_dirs = None,
            define_macros = None,
            undef_macros = None,
            library_dirs = None,
            libraries = None,
            runtime_library_dirs = None,
            extra_objects = None,
            extra_compile_args = None,
            extra_link_args = None,
            export_symbols = None,
            #swig_opts = None,
            depends = None,
            language = None,
            pyrex_include_dirs = None,
            pyrex_directives = None,
            pyrex_create_listing = 0,
            pyrex_line_directives = 0,
            pyrex_cplus = 0,
            pyrex_c_in_temp = 0,
            pyrex_gen_pxi = 0,
            pyrex_gdb = False,
            no_c_in_traceback = False,
            **kw):

        _Extension.Extension.__init__(self, name, sources,
            include_dirs = include_dirs,
            define_macros = define_macros,
            undef_macros = undef_macros,
            library_dirs = library_dirs,
            libraries = libraries,
            runtime_library_dirs = runtime_library_dirs,
            extra_objects = extra_objects,
            extra_compile_args = extra_compile_args,
            extra_link_args = extra_link_args,
            export_symbols = export_symbols,
            #swig_opts = swig_opts,
            depends = depends,
            language = language,
            **kw)

        self.pyrex_include_dirs = pyrex_include_dirs or []
        self.pyrex_directives = pyrex_directives or {}
        self.pyrex_create_listing = pyrex_create_listing
        self.pyrex_line_directives = pyrex_line_directives
        self.pyrex_cplus = pyrex_cplus
        self.pyrex_c_in_temp = pyrex_c_in_temp
        self.pyrex_gen_pxi = pyrex_gen_pxi
        self.pyrex_gdb = pyrex_gdb
        self.no_c_in_traceback = no_c_in_traceback

# class Extension

read_setup_file = _Extension.read_setup_file