当前位置: 首页>>代码示例>>Python>>正文


Python develop.develop方法代码示例

本文整理汇总了Python中setuptools.command.develop.develop方法的典型用法代码示例。如果您正苦于以下问题:Python develop.develop方法的具体用法?Python develop.develop怎么用?Python develop.develop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在setuptools.command.develop的用法示例。


在下文中一共展示了develop.develop方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_cmdclass

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def create_cmdclass(wrappers=None, data_dirs=None):
    """Create a command class with the given optional wrappers.

    Parameters
    ----------
    wrappers: list(str), optional
        The cmdclass names to run before running other commands
    data_dirs: list(str), optional.
        The directories containing static data.
    """
    egg = bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled
    wrappers = wrappers or []
    data_dirs = data_dirs or []
    wrapper = functools.partial(wrap_command, wrappers, data_dirs)
    cmdclass = dict(
        build_py=wrapper(build_py, strict=is_repo),
        sdist=wrapper(sdist, strict=True),
        bdist_egg=egg,
        develop=wrapper(develop, strict=True)
    )
    if bdist_wheel:
        cmdclass['bdist_wheel'] = wrapper(bdist_wheel, strict=True)
    return cmdclass 
开发者ID:K3D-tools,项目名称:K3D-jupyter,代码行数:25,代码来源:setupbase.py

示例2: make_extraversion

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def make_extraversion(editable=False):
    """Compile extra version information for use at runtime.

    Additional information will include:
     - values of DIST_NAME and DIST_PACKAGE environment variables
     - whether the installation is running in develop/editable mode
     - git HEAD commit hash and whether the tree is dirty
    """
    extra = {}
    extra['dist_name'] = os.getenv('DIST_NAME')
    extra['dist_package'] = os.getenv('DIST_PACKAGE')
    extra['editable'] = editable
    if get_git_version() and os.path.isdir('.git'):
        rev_parse = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode()
        describe = subprocess.check_output(['git', 'describe', '--always', '--dirty']).strip().decode()
        extra['commit'] = rev_parse
        extra['dirty'] = describe.endswith('-dirty')
    with open('liquidctl/extraversion.py', 'w') as fv:
        fv.write('__extraversion__ = {!r}'.format(extra)) 
开发者ID:jonasmalacofilho,项目名称:liquidctl,代码行数:21,代码来源:setup.py

示例3: install_wrapper_scripts

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def install_wrapper_scripts(self, dist):
        develop.develop.install_wrapper_scripts(self, dist)
        if self.exclude_scripts:
            return
        script = easy_install.get_script_header("") + SCRIPT_TMPL
        if PY3:
            script = script.encode('ascii')
        self.write_script("gnocchi-api", script, 'b') 
开发者ID:gnocchixyz,项目名称:gnocchi,代码行数:10,代码来源:setuptools.py

示例4: setup

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def setup(**kwargs):
    cmdclass = kwargs.setdefault("cmdclass", {})
    cmdclass["develop"] = type(
        "develop_with_pth_hook",
        (pth_hook_mixin, cmdclass.get("develop", develop)),
        {})
    cmdclass["install_lib"] = type(
        "install_lib_with_pth_hook",
        (pth_hook_mixin, cmdclass.get("install_lib", install_lib)),
        {})
    setuptools.setup(**kwargs) 
开发者ID:anntzer,项目名称:mplcursors,代码行数:13,代码来源:setupext.py

示例5: install_wrapper_scripts

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def install_wrapper_scripts(self, dist):
        if sys.platform == 'win32':
            return develop.develop.install_wrapper_scripts(self, dist)
        if not self.exclude_scripts:
            for args in override_get_script_args(dist):
                self.write_script(*args) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:8,代码来源:packaging.py

示例6: install_geonotebook_ini

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def install_geonotebook_ini(cmd, link=False):

    # cmd.dist is a pkg_resources.Distribution class, See:
    # http://setuptools.readthedocs.io/en/latest/pkg_resources.html#distribution-objects

    # pkg_resources.Distribution.location can be a lot of things,  but in the
    # case of a develop install it will be the path to the source tree. This
    # will not work if applied to more exotic install targets
    # (e.g. pip install -e git@github.com:OpenGeoscience/geonotebook.git)
    base_dir = cmd.dist.location
    # cmd.distribution is a setuptools.dist.Distribution class, See:
    # https://github.com/pypa/setuptools/blob/master/setuptools/dist.py#L215
    for sys_path, local_paths in cmd.distribution.data_files:
        try:
            os.makedirs(os.path.join(sys.prefix, sys_path))
        except OSError:
            pass

        for local_path in local_paths:
            for l in glob.glob(local_path):
                src = os.path.join(base_dir, l)

                dest = os.path.join(sys_path, os.path.basename(src))\
                    if sys_path.startswith("/") else \
                    os.path.join(sys.prefix, sys_path, os.path.basename(src))

                if os.path.lexists(dest):
                    os.remove(dest)

                if link:
                    log.info("linking {} to {}".format(src, dest))
                    os.symlink(src, dest)
                else:
                    log.info("copying {} to {}".format(src, dest))
                    shutil.copyfile(src, dest) 
开发者ID:OpenGeoscience,项目名称:geonotebook,代码行数:37,代码来源:setup.py

示例7: _get_develop_handler

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def _get_develop_handler():
    """Get a handler for the develop command"""
    class _develop(develop):

        def install_for_development(self):
            super(_develop, self).install_for_development()
            self.run_command('handle_files')
            for _, filenames in self.distribution.data_files:
                for filename in filenames:
                    target = os.path.join(sys.prefix, filename)
                    self.mkpath(os.path.dirname(target))
                    outf, copied = self.copy_file(filename, target)

    return _develop 
开发者ID:jupyter,项目名称:jupyter-packaging,代码行数:16,代码来源:setupbase.py

示例8: create_cmdclass

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def create_cmdclass(prerelease_cmd=None, package_data_spec=None,
        data_files_spec=None):
    """Create a command class with the given optional prerelease class.

    Parameters
    ----------
    prerelease_cmd: (name, Command) tuple, optional
        The command to run before releasing.
    package_data_spec: dict, optional
        A dictionary whose keys are the dotted package names and
        whose values are a list of glob patterns.
    data_files_spec: list, optional
        A list of (path, dname, pattern) tuples where the path is the
        `data_files` install path, dname is the source directory, and the
        pattern is a glob pattern.

    Notes
    -----
    We use specs so that we can find the files *after* the build
    command has run.

    The package data glob patterns should be relative paths from the package
    folder containing the __init__.py file, which is given as the package
    name.
    e.g. `dict(foo=['./bar/*', './baz/**'])`

    The data files directories should be absolute paths or relative paths
    from the root directory of the repository.  Data files are specified
    differently from `package_data` because we need a separate path entry
    for each nested folder in `data_files`, and this makes it easier to
    parse.
    e.g. `('share/foo/bar', 'pkgname/bizz, '*')`
    """
    wrapped = [prerelease_cmd] if prerelease_cmd else []
    if package_data_spec or data_files_spec:
        wrapped.append('handle_files')
    wrapper = functools.partial(_wrap_command, wrapped)
    handle_files = _get_file_handler(package_data_spec, data_files_spec)

    if 'bdist_egg' in sys.argv:
        egg = wrapper(bdist_egg, strict=True)
    else:
        egg = bdist_egg_disabled

    cmdclass = dict(
        build_py=wrapper(build_py, strict=is_repo),
        bdist_egg=egg,
        sdist=wrapper(sdist, strict=True),
        handle_files=handle_files,
    )

    if bdist_wheel:
        cmdclass['bdist_wheel'] = wrapper(bdist_wheel, strict=True)

    cmdclass['develop'] = wrapper(develop, strict=True)
    return cmdclass 
开发者ID:jupyter-widgets,项目名称:jupyterlab-sidecar,代码行数:58,代码来源:setupbase.py

示例9: test_develop

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def test_develop(self):
        if sys.version < "2.6" or hasattr(sys, 'real_prefix'):
            return
        dist = Distribution(
            dict(name='foo',
                 packages=['foo'],
                 use_2to3=True,
                 version='0.0',
                 ))
        dist.script_name = 'setup.py'
        cmd = develop(dist)
        cmd.user = 1
        cmd.ensure_finalized()
        cmd.install_dir = site.USER_SITE
        cmd.user = 1
        old_stdout = sys.stdout
        #sys.stdout = StringIO()
        try:
            cmd.run()
        finally:
            sys.stdout = old_stdout

        # let's see if we got our egg link at the right place
        content = os.listdir(site.USER_SITE)
        content.sort()
        self.assertEqual(content, ['easy-install.pth', 'foo.egg-link'])

        # Check that we are using the right code.
        egg_link_file = open(os.path.join(site.USER_SITE, 'foo.egg-link'), 'rt')
        try:
            path = egg_link_file.read().split()[0].strip()
        finally:
            egg_link_file.close()
        init_file = open(os.path.join(path, 'foo', '__init__.py'), 'rt')
        try:
            init = init_file.read().strip()
        finally:
            init_file.close()
        if sys.version < "3":
            self.assertEqual(init, 'print "foo"')
        else:
            self.assertEqual(init, 'print("foo")') 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:44,代码来源:test_develop.py

示例10: create_cmdclass

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def create_cmdclass(prerelease_cmd=None, package_data_spec=None, data_files_spec=None):
    """Create a command class with the given optional prerelease class.

    Parameters
    ----------
    prerelease_cmd: (name, Command) tuple, optional
        The command to run before releasing.
    package_data_spec: dict, optional
        A dictionary whose keys are the dotted package names and
        whose values are a list of glob patterns.
    data_files_spec: list, optional
        A list of (path, dname, pattern) tuples where the path is the
        `data_files` install path, dname is the source directory, and the
        pattern is a glob pattern.

    Notes
    -----
    We use specs so that we can find the files *after* the build
    command has run.

    The package data glob patterns should be relative paths from the package
    folder containing the __init__.py file, which is given as the package
    name.
    e.g. `dict(foo=['./bar/*', './baz/**'])`

    The data files directories should be absolute paths or relative paths
    from the root directory of the repository.  Data files are specified
    differently from `package_data` because we need a separate path entry
    for each nested folder in `data_files`, and this makes it easier to
    parse.
    e.g. `('share/foo/bar', 'pkgname/bizz, '*')`
    """
    wrapped = [prerelease_cmd] if prerelease_cmd else []
    if package_data_spec or data_files_spec:
        wrapped.append("handle_files")
    wrapper = functools.partial(_wrap_command, wrapped)
    handle_files = _get_file_handler(package_data_spec, data_files_spec)

    if "bdist_egg" in sys.argv:
        egg = wrapper(bdist_egg, strict=True)
    else:
        egg = bdist_egg_disabled

    cmdclass = dict(
        build_py=wrapper(build_py, strict=is_repo),
        bdist_egg=egg,
        sdist=wrapper(sdist, strict=True),
        handle_files=handle_files,
    )

    if bdist_wheel:
        cmdclass["bdist_wheel"] = wrapper(bdist_wheel, strict=True)

    cmdclass["develop"] = wrapper(develop, strict=True)
    return cmdclass 
开发者ID:IBM,项目名称:jupyterlab-s3-browser,代码行数:57,代码来源:setupbase.py

示例11: create_cmdclass

# 需要导入模块: from setuptools.command import develop [as 别名]
# 或者: from setuptools.command.develop import develop [as 别名]
def create_cmdclass(prerelease_cmd=None, package_data_spec=None,
                    data_files_spec=None):
    """Create a command class with the given optional prerelease class.

    Parameters
    ----------
    prerelease_cmd: (name, Command) tuple, optional
        The command to run before releasing.
    package_data_spec: dict, optional
        A dictionary whose keys are the dotted package names and
        whose values are a list of glob patterns.
    data_files_spec: list, optional
        A list of (path, dname, pattern) tuples where the path is the
        `data_files` install path, dname is the source directory, and the
        pattern is a glob pattern.

    Notes
    -----
    We use specs so that we can find the files *after* the build
    command has run.

    The package data glob patterns should be relative paths from the package
    folder containing the __init__.py file, which is given as the package
    name.
    e.g. `dict(foo=['./bar/*', './baz/**'])`

    The data files directories should be absolute paths or relative paths
    from the root directory of the repository.  Data files are specified
    differently from `package_data` because we need a separate path entry
    for each nested folder in `data_files`, and this makes it easier to
    parse.
    e.g. `('share/foo/bar', 'pkgname/bizz, '*')`
    """
    wrapped = [prerelease_cmd] if prerelease_cmd else []
    if package_data_spec or data_files_spec:
        wrapped.append('handle_files')

    wrapper = functools.partial(_wrap_command, wrapped)
    handle_files = _get_file_handler(package_data_spec, data_files_spec)
    develop_handler = _get_develop_handler()

    if 'bdist_egg' in sys.argv:
        egg = wrapper(bdist_egg, strict=True)
    else:
        egg = bdist_egg_disabled

    is_repo = os.path.exists('.git')

    cmdclass = dict(
        build_py=wrapper(build_py, strict=is_repo),
        bdist_egg=egg,
        sdist=wrapper(sdist, strict=True),
        handle_files=handle_files,
    )

    if bdist_wheel:
        cmdclass['bdist_wheel'] = wrapper(bdist_wheel, strict=True)

    cmdclass['develop'] = wrapper(develop_handler, strict=True)
    return cmdclass 
开发者ID:jupyter,项目名称:jupyter-packaging,代码行数:62,代码来源:setupbase.py


注:本文中的setuptools.command.develop.develop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。