Runtime#
This code is run when initializing the python interperter in a Relenv environment.
Point Relenv’s Openssl to the system installed Openssl certificate path
Make sure pip creates scripts with a shebang that points to the correct python using a relative path.
On linux, provide pip with the proper location of the Relenv toolchain gcc. This ensures when using pip any c dependencies are compiled against the proper glibc version.
- class relenv.runtime.RelenvImporter#
An importer to be added to
sys.meta_path
to handle importing into a relenv environment.- find_module(module_name, package_path=None)#
Find a module for importing into the relenv environment.
- Parameters:
module_name (str) – The name of the module
package_path (str, optional) – The path to the package, defaults to None
- Returns:
The instance that called this method if it found the module, or None if it didn’t
- Return type:
RelenvImporter or None
- load_module(name)#
Load the given module.
- Parameters:
name (str) – The module name to load
- Returns:
The loaded module or the calling instance if importing sysconfigdata
- Return type:
types.ModuleType or RelenvImporter
- relenv.runtime.bootstrap()#
Bootstrap the relenv environment.
- relenv.runtime.debug(string)#
Prints the provided message if RELENV_DEBUG is truthy in the environment.
- Parameters:
string (str) – The message to print
- relenv.runtime.finalize_options_wrapper(func)#
Wrapper around build_ext.finalize_options.
Used to add the relenv environment’s include path.
- relenv.runtime.get_config_var_wrapper(func)#
Return a wrapper to resolve paths relative to the relenv root.
- relenv.runtime.get_major_version()#
Current python major version.
- relenv.runtime.get_paths_wrapper(func, default_scheme)#
Return a wrapper to resolve paths relative to the relenv root.
- relenv.runtime.install_legacy_wrapper(func)#
Wrap pip’s legacy install function.
This method determines any newly installed files and checks their RPATHs.
- relenv.runtime.install_wheel_wrapper(func)#
Wrap pip’s wheel install function.
This method determines any newly installed files and checks their RPATHs.
- relenv.runtime.pushd(new_dir)#
Changedir context.
- relenv.runtime.relenv_root()#
Return the relenv module root.