How to use apipkg - 6 common examples

To help you get started, we’ve selected a few apipkg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytest-dev / execnet / execnet / __init__.py View on Github external
# -*- coding: utf-8 -*-
"""
execnet
-------

pure python lib for connecting to local and remote Python Interpreters.

(c) 2012, Holger Krekel and others
"""
import apipkg

apipkg.initpkg(
    __name__,
    {
        "__version__": "._version:version",
        "PopenGateway": ".deprecated:PopenGateway",
        "SocketGateway": ".deprecated:SocketGateway",
        "SshGateway": ".deprecated:SshGateway",
        "makegateway": ".multi:makegateway",
        "set_execmodel": ".multi:set_execmodel",
        "HostNotFound": ".gateway_bootstrap:HostNotFound",
        "RemoteError": ".gateway_base:RemoteError",
        "TimeoutError": ".gateway_base:TimeoutError",
        "XSpec": ".xspec:XSpec",
        "Group": ".multi:Group",
        "MultiChannel": ".multi:MultiChannel",
        "RSync": ".rsync:RSync",
        "default_group": ".multi:default_group",
github pymedphys / pymedphys / pymedphys / __init__.py View on Github external
"""Module docstring."""

import apipkg

apipkg.initpkg(
    __name__,
    {
        "data_path": "._data:data_path",
        "zip_data_paths": "._data:zip_data_paths",
        "Delivery": "._delivery:Delivery",
        "gamma": "._gamma.implementation.shell:gamma_shell",
        "read_trf": "._trf:read_trf",
        "__version__": "._version:__version__",
        "version_info": "._version:version_info",
    },
)

from . import (  # isort:skip pylint:disable = wrong-import-position
    dicom,
github vit1251 / clish / src / clish / __init__.py View on Github external
#

import apipkg
apipkg.initpkg(__name__, {
    'commands': {
        "HelpCommand": "clish._commands._HelpCommand:HelpCommand",
        "ExitCommand": "clish._commands._ExitCommand:ExitCommand",
    },

    'Namespace': "clish._Namespace:Namespace",
    'Command'  : "clish._Command:Command",
    'Shell'    : "clish._Shell:Shell",

    # DEPRECATE NAMES
    'InteractiveCommand' : "clish._Command:Command",
    'InteractiveShell'   : "clish._Shell:Shell",
})
github servo / mozjs / mozjs / third_party / python / py / py / __init__.py View on Github external
from py._vendored_packages import apipkg
    lib_not_mangled_by_packagers = True
    vendor_prefix = '._vendored_packages.'
except ImportError:
    import apipkg
    lib_not_mangled_by_packagers = False
    vendor_prefix = ''

try:
    from ._version import version as __version__
except ImportError:
    # broken installation, we don't even try
    __version__ = "unknown"


apipkg.initpkg(__name__, attr={'_apipkg': apipkg, 'error': error}, exportdefs={
    # access to all standard lib modules
    'std': '._std:std',

    '_pydir' : '.__metainfo:pydir',
    'version': 'py:__version__', # backward compatibility

    # pytest-2.0 has a flat namespace, we use alias modules
    # to keep old references compatible
    'test' : 'pytest',

    # hook into the top-level standard library
    'process' : {
        '__doc__'        : '._process:__doc__',
        'cmdexec'        : '._process.cmdexec:cmdexec',
        'kill'           : '._process.killproc:kill',
        'ForkedFunc'     : '._process.forkedfunc:ForkedFunc',
github catboost / catboost / contrib / python / py / py / __init__.py View on Github external
from py._vendored_packages import apipkg
    lib_not_mangled_by_packagers = True
    vendor_prefix = '._vendored_packages.'
except ImportError:
    import apipkg
    lib_not_mangled_by_packagers = False
    vendor_prefix = ''

try:
    from ._version import version as __version__
except ImportError:
    # broken installation, we don't even try
    __version__ = "unknown"


apipkg.initpkg(__name__, attr={'_apipkg': apipkg, 'error': error}, exportdefs={
    # access to all standard lib modules
    'std': '._std:std',

    '_pydir' : '.__metainfo:pydir',
    'version': 'py:__version__', # backward compatibility

    # pytest-2.0 has a flat namespace, we use alias modules
    # to keep old references compatible
    'test' : 'pytest',

    # hook into the top-level standard library
    'process' : {
        '__doc__'        : '._process:__doc__',
        'cmdexec'        : '._process.cmdexec:cmdexec',
        'kill'           : '._process.killproc:kill',
        'ForkedFunc'     : '._process.forkedfunc:ForkedFunc',
github pediapress / mwlib / mwlib / async / __init__.py View on Github external
from apipkg import initpkg
initpkg(
    __name__,
    dict(
        jobs="qs.jobs",
        proc="qs.proc",
        qserve="qs.qserve",
        rpcclient="qs.rpcclient",
        rpcserver="qs.rpcserver",
        slave="qs.slave"))

apipkg

apipkg: namespace control and lazy-import mechanism

MIT
Latest version published 1 year ago

Package Health Score

62 / 100
Full package analysis

Popular apipkg functions