Configuration.add_extension(name, sources, **kw)

Add extension to configuration.

Create and add an Extension instance to the ext_modules list. This method also takes the following optional keyword arguments that are passed on to the Extension constructor.


name: str :

name of the extension

sources: seq :

list of the sources. The list of sources may contain functions (called source generators) which must take an extension instance and a build directory as inputs and return a source file or list of source files or None. If None is returned then no sources are generated. If the Extension instance has no sources after processing all source generators, then no extension module is built.

include_dirs: :

define_macros: :

undef_macros: :

library_dirs: :

libraries: :

runtime_library_dirs: :

extra_objects: :

extra_compile_args: :

extra_link_args: :

export_symbols: :

swig_opts: :

depends: :

The depends list contains paths to files or directories that the sources of the extension module depend on. If any path in the depends list is newer than the extension module, then the module will be rebuilt.

language: :

f2py_options: :

module_dirs: :

extra_info: dict,list :

dict or list of dict of keywords to be appended to keywords.


The self.paths(...) method is applied to all lists that may contain paths.

This Page