コード例 #1
0
# Make sure we're actually in the directory containing setup.py.
root_dir = os.path.dirname(__file__)

if root_dir != '':
    os.chdir(root_dir)

# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

if is_packaging:
    # If we're packaging, include the package-only dependencies.
    package_dependencies = package_dependencies.copy()
    package_dependencies.update(package_only_dependencies)


class BuildEggInfoCommand(egg_info):
    """Build the egg information for the package.

    If this is called when building a distribution (source, egg, or wheel),
    or when installing the package from source, this will kick off tasks for
    building static media and string localization files.
    """
    def run(self):
        """Build the egg information."""
        if is_packaging:
            self.run_command('build_media')
            self.run_command('build_i18n')
コード例 #2
0
ファイル: setup.py プロジェクト: xiaogao6681/reviewboard
# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']


is_packaging = ('sdist' in sys.argv or
                'bdist_egg' in sys.argv or
                'bdist_wheel' in sys.argv or
                'install' in sys.argv)

if is_packaging:
    # If we're packaging, include the package-only dependencies.
    package_dependencies = package_dependencies.copy()
    package_dependencies.update(package_only_dependencies)


class BuildEggInfoCommand(egg_info):
    """Build the egg information for the package.

    If this is called when building a distribution (source, egg, or wheel),
    or when installing the package from source, this will kick off tasks for
    building static media and string localization files.
    """

    def run(self):
        """Build the egg information."""
        if is_packaging:
            self.run_command('build_media')
            self.run_command('build_i18n')