Python distutils.command.build.build.run() Examples

The following are 30 code examples for showing how to use distutils.command.build.build.run(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module distutils.command.build.build , or try the search function .

Example 1
Project: delocate   Author: matthew-brett   File: versioneer.py    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print("UPDATING %s" % target_versionfile)
            os.unlink(target_versionfile)
            f = open(target_versionfile, "w")
            f.write(SHORT_VERSION_PY % versions)
            f.close()
            _build_exe.run(self)
            os.unlink(target_versionfile)
            f = open(versionfile_source, "w")
            f.write(LONG_VERSION_PY % {"DOLLAR": "$",
                                       "TAG_PREFIX": tag_prefix,
                                       "PARENTDIR_PREFIX": parentdir_prefix,
                                       "VERSIONFILE_SOURCE": versionfile_source,
                                       })
            f.close() 
Example 2
Project: cysignals   Author: sagemath   File: setup.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def run(self):
        """
        Run ``./configure`` and Cython first.
        """
        config_h = opj("src", "cysignals", "cysignals_config.h")
        if not os.path.isfile(config_h):
            import subprocess
            subprocess.check_call(["make", "configure"])
            subprocess.check_call(["sh", "configure"])

        dist = self.distribution
        ext_modules = dist.ext_modules
        if ext_modules:
            dist.ext_modules[:] = self.cythonize(ext_modules)

        _build.run(self) 
Example 3
Project: GitIssueBot   Author: foosel   File: versioneer.py    License: GNU Affero General Public License v3.0 6 votes vote down vote up
def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print("UPDATING %s" % target_versionfile)
            os.unlink(target_versionfile)
            f = open(target_versionfile, "w")
            f.write(SHORT_VERSION_PY % versions)
            f.close()
            _build_exe.run(self)
            os.unlink(target_versionfile)
            f = open(versionfile_source, "w")
            f.write(LONG_VERSION_PY % {"DOLLAR": "$",
                                       "TAG_PREFIX": tag_prefix,
                                       "PARENTDIR_PREFIX": parentdir_prefix,
                                       "VERSIONFILE_SOURCE": versionfile_source,
                                       })
            f.close() 
Example 4
Project: netconnectd   Author: foosel   File: versioneer.py    License: GNU Affero General Public License v3.0 6 votes vote down vote up
def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print("UPDATING %s" % target_versionfile)
            os.unlink(target_versionfile)
            f = open(target_versionfile, "w")
            f.write(SHORT_VERSION_PY % versions)
            f.close()
            _build_exe.run(self)
            os.unlink(target_versionfile)
            f = open(versionfile_source, "w")
            f.write(LONG_VERSION_PY % {"DOLLAR": "$",
                                       "TAG_PREFIX": tag_prefix,
                                       "PARENTDIR_PREFIX": parentdir_prefix,
                                       "VERSIONFILE_SOURCE": versionfile_source,
                                       "LOOKUPFILE": '"%s"' % lookupfile if lookupfile is not None else "None",
                                       })
            f.close() 
Example 5
Project: byro   Author: byro   File: setup.py    License: Apache License 2.0 6 votes vote down vote up
def run(self):
        environ.setdefault("DJANGO_SETTINGS_MODULE", "byro.settings")
        try:
            import django
        except ImportError:  # Move to ModuleNotFoundError once we drop Python 3.5
            return
        django.setup()
        from django.conf import settings
        from django.core import management

        settings.COMPRESS_ENABLED = True
        settings.COMPRESS_OFFLINE = True

        management.call_command("compilemessages", verbosity=1)
        management.call_command("collectstatic", verbosity=1, interactive=False)
        management.call_command("compress", verbosity=1)
        build.run(self) 
Example 6
Project: skein   Author: jcrist   File: setup.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def run(self):
        from grpc_tools import protoc
        include = pkg_resources.resource_filename('grpc_tools', '_proto')
        for src in glob(os.path.join(JAVA_PROTO_DIR, "*.proto")):
            command = ['grpc_tools.protoc',
                       '--proto_path=%s' % JAVA_PROTO_DIR,
                       '--proto_path=%s' % include,
                       '--python_out=%s' % SKEIN_PROTO_DIR,
                       '--grpc_python_out=%s' % SKEIN_PROTO_DIR,
                       src]
            if protoc.main(command) != 0:
                self.warn('Command: `%s` failed'.format(command))
                sys.exit(1)

        for path in _compiled_protos():
            self._fix_imports(path) 
Example 7
Project: BASS   Author: Cisco-Talos   File: setup.py    License: GNU General Public License v2.0 5 votes vote down vote up
def run(self):
        self.run_command('build_ext')
        build.run(self) 
Example 8
Project: BASS   Author: Cisco-Talos   File: setup.py    License: GNU General Public License v2.0 5 votes vote down vote up
def run(self):
        self.run_command('build_ext')
        self.do_egg_install() 
Example 9
Project: delocate   Author: matthew-brett   File: versioneer.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
    assert isinstance(commands, list)
    p = None
    for c in commands:
        try:
            # remember shell=False, so use git.cmd on windows, not just git
            p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
                                 stderr=(subprocess.PIPE if hide_stderr
                                         else None))
            break
        except EnvironmentError:
            e = sys.exc_info()[1]
            if e.errno == errno.ENOENT:
                continue
            if verbose:
                print("unable to run %s" % args[0])
                print(e)
            return None
    else:
        if verbose:
            print("unable to find command, tried %s" % (commands,))
        return None
    stdout = p.communicate()[0].strip()
    if sys.version >= '3':
        stdout = stdout.decode()
    if p.returncode != 0:
        if verbose:
            print("unable to run %s (error)" % args[0])
        return None
    return stdout 
Example 10
Project: delocate   Author: matthew-brett   File: versioneer.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        ver = get_version(verbose=True)
        print("Version is currently: %s" % ver) 
Example 11
Project: delocate   Author: matthew-brett   File: versioneer.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        versions = get_versions(verbose=True)
        _build.run(self)
        # now locate _version.py in the new build/ directory and replace it
        # with an updated value
        target_versionfile = os.path.join(self.build_lib, versionfile_build)
        print("UPDATING %s" % target_versionfile)
        os.unlink(target_versionfile)
        f = open(target_versionfile, "w")
        f.write(SHORT_VERSION_PY % versions)
        f.close() 
Example 12
Project: delocate   Author: matthew-brett   File: versioneer.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        versions = get_versions(verbose=True)
        self._versioneer_generated_versions = versions
        # unless we update this, the command will keep using the old version
        self.distribution.metadata.version = versions["version"]
        return _sdist.run(self) 
Example 13
Project: pyeclib   Author: openstack   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        self.check_liberasure()
        _build.run(self) 
Example 14
Project: pyeclib   Author: openstack   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        _clean.run(self) 
Example 15
Project: pyeclib   Author: openstack   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):

        install_cmd = self.distribution.get_command_obj('install')
        install_lib = self.distribution.get_command_obj('install_lib')
        for cmd in (install_lib, install_cmd):
            cmd.ensure_finalized()

        # ensure that the paths are absolute so we don't get lost
        opts = {'exec_prefix': install_cmd.exec_prefix,
                'root': install_cmd.root}
        for optname, value in list(opts.items()):
            if value is not None:
                opts[optname] = os.path.abspath(value)

        installroot = install_lib.install_dir
        _install.run(self)

        # Another Mac-ism...  If the libraries are installed
        # in a strange place, DYLD_LIRBARY_PATH needs to be
        # updated.
        if platform_str.find("Darwin") > -1:
            ldpath_str = "DYLD_LIBRARY_PATH"
        else:
            ldpath_str = "LD_LIBRARY_PATH"
        print("***************************************************")
        print("**                                                 ")
        print("** PyECLib libraries have been installed to:       ")
        print("**   %s" % installroot)
        print("**                                                 ")
        print("** Any user using this library must update:        ")
        print("**   %s" % ldpath_str)
        print("**                                                 ")
        print("** Run 'ldconfig' or place this line:              ")
        print("**   export %s=%s" % (ldpath_str, "%s"
                                     % installroot))
        print("**                                                 ")
        print("** into .bashrc, .profile, or the appropriate shell")
        print("** start-up script!  Also look at ldconfig(8) man  ")
        print("** page for a more static LD configuration         ")
        print("**                                                 ")
        print("***************************************************") 
Example 16
Project: recruit   Author: Frank-qlu   File: build.py    License: Apache License 2.0 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 17
Project: lambda-packs   Author: ryfeus   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 18
Project: lambda-packs   Author: ryfeus   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 19
Project: reviewer_experience_prediction   Author: mulhod   File: setup.py    License: MIT License 5 votes vote down vote up
def run(self):
        __builtins__.__NUMPY_SETUP__ = False
        import numpy
        print(numpy.get_include())
        _build.run(self) 
Example 20
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 21
Project: vnpy_crypto   Author: birforce   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 22
Project: cysignals   Author: sagemath   File: setup.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
def run(self):
        dist = self.distribution
        ext_modules = dist.ext_modules
        if ext_modules:
            dist.ext_modules[:] = self.cythonize(ext_modules)
        _build.run(self) 
Example 23
Project: cysignals   Author: sagemath   File: setup.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
def run(self):
        from distutils.errors import DistutilsOptionError
        raise DistutilsOptionError("The package cysignals will not function correctly when built as egg. Therefore, it cannot be installed using 'python setup.py install' or 'easy_install'. Instead, use 'pip install' to install cysignals.") 
Example 24
Project: automation-hat   Author: pimoroni   File: setup.py    License: MIT License 5 votes vote down vote up
def run(self):
        if test is not None and test.test is not None:
            assert test.test() == True, "Automated tests failed!"
            print("notice  all tests passed: OK!")
        else:
            print("notice  automated tests skipped!")

        build.run(self) 
Example 25
Project: automation-hat   Author: pimoroni   File: setup.py    License: MIT License 5 votes vote down vote up
def run(self):
        if test is not None and test.test is not None:
            assert test.test() == True, "Automated tests failed!"
            print("notice  all tests passed: OK!")
        else:
            print("notice  automated tests skipped!") 
Example 26
Project: Computable   Author: ktraunmueller   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 27
Project: Mastering-Elasticsearch-7.0   Author: PacktPublishing   File: build.py    License: MIT License 5 votes vote down vote up
def run(self):
        old_build.run(self) 
Example 28
Project: fontgoggles   Author: justvanrossum   File: setup.py    License: Apache License 2.0 5 votes vote down vote up
def run(self):
        # Build our C library
        subprocess.check_call(['./Turbo/build_lib.sh'])
        _build.run(self) 
Example 29
Project: angr   Author: angr   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self, *args):
        self.execute(_build_native, (), msg='Building angr_native')
        _build.run(self, *args) 
Example 30
Project: angr   Author: angr   File: setup.py    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self, *args):
        self.execute(_clean_native, (), msg='Cleaning angr_native')
        _clean.run(self, *args)