Package _setup :: Module ext :: Class Extension
[hide private]
[frames] | no frames]

Class Extension

source code

distutils.extension.Extension --+
                                |
                               Extension

Extension with prerequisite check interface

If your check is cacheable (during the setup run), override cached_check_prerequisites, check_prerequisites otherwise.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Initialization
source code
bool
check_prerequisites(self, build)
Check prerequisites
source code
bool
cached_check_prerequisites(self, build)
Check prerequisites
source code
Instance Variables [hide private]
bool cached_check = None
The cached check result
Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Initialization
Overrides: distutils.extension.Extension.__init__

check_prerequisites(self, build)

source code 

Check prerequisites

The check should cover all dependencies needed for the extension to be built and run. The method can do the following:

  • return a false value: the extension will be built
  • return a true value: the extension will be skipped. This is useful for optional extensions
  • raise an exception. This is useful for mandatory extensions

If the check result is cacheable (during the setup run), override cached_check_prerequisites instead.

Parameters:
  • build (BuildExt) - The extension builder
Returns: bool
Skip the extension?

cached_check_prerequisites(self, build)

source code 

Check prerequisites

The check should cover all dependencies needed for the extension to be built and run. The method can do the following:

  • return a false value: the extension will be built
  • return a true value: the extension will be skipped. This is useful for optional extensions
  • raise an exception. This is useful for mandatory extensions

If the check result is not cacheable (during the setup run), override check_prerequisites instead.

Parameters:
  • build (BuildExt) - The extension builder
Returns: bool
Skip the extension?