Exemple #1
0
    def run(self):
        # if 'build' was called explicitly, flag that requests etc. should be fetched
        if 'install' not in sys.argv:
            os.environ['ACTION'] = 'build'

        # compile the dependencies into build/lib/plotdevice/lib...
        self.spawn(
            [sys.executable, 'app/deps/build.py',
             abspath(self.build_lib)])

        # ...then let the real build_py routine do its thing
        build_py.run(self)

        # include some ui resources for running a script from the command line
        rsrc_dir = '%s/plotdevice/rsrc' % self.build_lib
        self.mkpath(rsrc_dir)

        self.copy_file("app/Resources/colors.json",
                       '%s/colors.json' % rsrc_dir)
        self.copy_file("app/Resources/PlotDeviceFile.icns",
                       '%s/viewer.icns' % rsrc_dir)
        for dst, src in stale(
                '%s/viewer.nib' % rsrc_dir,
                src="app/Resources/English.lproj/PlotDeviceScript.xib"):
            self.spawn(['/usr/bin/ibtool', '--compile', dst, src])
Exemple #2
0
    def run(self):
        generate_main_proto()

        for model in models:
            generate_model_proto(model)

        _build_py.run(self)
Exemple #3
0
 def run(self):
     build_py_2to3.run(self)
     print("copying aux dirs")
     loglevel = log.set_threshold(log.ERROR)
     for source in ['tools', 'test']:
         dest = os.path.join(self.build_lib, source)
         copydir_run_2to3(source, dest, template=self.manifest_in)
     log.set_threshold(loglevel)
Exemple #4
0
 def run(self):
     # fix
     print("build_py_2to3")
     build_py_2to3.run(self)
     print("copy/convert test suite")
     loglevel = log.set_threshold(log.ERROR)
     copydir_run_2to3('test', 'test3', template=self.manifest_in)
     log.set_threshold(loglevel)
 def run(self):
     build_py_2to3.run(self)
     print("copying aux dirs")
     loglevel = log.set_threshold(log.ERROR)
     for source in ['tools', 'test']:
         dest = os.path.join(self.build_lib, source)
         copydir_run_2to3(source, dest, template=self.manifest_in)
     log.set_threshold(loglevel)
Exemple #6
0
 def run(self):
     # fix
     print("build_py_2to3")
     build_py_2to3.run(self)
     print("copy/convert test suite")
     loglevel = log.set_threshold(log.ERROR)
     copydir_run_2to3('test', 'test3', template=self.manifest_in)
     log.set_threshold(loglevel)
Exemple #7
0
 def run(self):
     errno = subprocess.call(
         ['python', 'compile.py', '.', '--python-out', '.'])
     if errno != 0:
         print('call `python compile.py` failed with errno: %d' % errno)
         exit(1)
     open('pymaid/pb/__init__.py', 'a').close()
     # _build_py is an old-style class, so super() doesn't work.
     _build_py.run(self)
Exemple #8
0
 def run(self):
     source_path = '../src/%s/protobuf/' % PROJECT
     # Generate necessary .proto file if it doesn't exist.
     for entry in os.listdir(source_path):
         filepath = os.path.join(source_path, entry)
         if os.path.isfile(filepath) and filepath.endswith('.proto'):
             generate_proto(filepath)
     # _build_py is an old-style class, so super() doesn't work.
     _build_py.run(self)
Exemple #9
0
  def run(self):
    source_path = '../src/%s/protobuf/' % PROJECT

    # Generate necessary .proto file if it doesn't exist.
    for entry in os.listdir(source_path):
      filepath = os.path.join(source_path, entry)
      if os.path.isfile(filepath) and filepath.endswith('.proto'):
          generate_proto(filepath)

    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #10
0
    def run(self):
        # honor the --dry-run flag
        if not self.dry_run:
            target_dir = os.path.join(self.build_lib, 'yt')
            src_dir = os.getcwd()
            changeset = get_mercurial_changeset_id(src_dir)
            self.mkpath(target_dir)
            with open(os.path.join(target_dir, '__hg_version__.py'),
                      'w') as fobj:
                fobj.write("hg_version = '%s'\n" % changeset)

        build_py.run(self)
Exemple #11
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
Exemple #12
0
    def run(self):
        # Generate necessary .proto file if it doesn't exist.
        generate_proto("../src/google/protobuf/descriptor.proto")
        generate_proto("../src/google/protobuf/compiler/plugin.proto")
        GenerateUnittestProtos()

        # Make sure google.protobuf/** are valid packages.
        for path in ['', 'internal/', 'compiler/', 'pyext/']:
            try:
                open('google/protobuf/%s__init__.py' % path, 'a').close()
            except EnvironmentError:
                pass
        # _build_py is an old-style class, so super() doesn't work.
        _build_py.run(self)
Exemple #13
0
  def run(self):
    # Generate necessary .proto file if it doesn't exist.
    generate_proto("../src/google/protobuf/descriptor.proto")
    generate_proto("../src/google/protobuf/compiler/plugin.proto")
    GenerateUnittestProtos()

    # Make sure google.protobuf/** are valid packages.
    for path in ['', 'internal/', 'compiler/', 'pyext/']:
      try:
        open('google/protobuf/%s__init__.py' % path, 'a').close()
      except EnvironmentError:
        pass
    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #14
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
Exemple #15
0
 def run(self):
     # Make sure we first run the build (including running 2to3 for Python3)
     # and then import from the build directory
     build_py.run(self)
     sys.path.insert(0, self.build_lib)
     from brian2.core.preferences import brian_prefs
     
     # We generate the file directly in the build directory
     try:
         with open(os.path.join(self.build_lib,
                                'brian2', 'default_preferences'), 'wt') as f:
             defaults = brian_prefs.defaults_as_file
             f.write(defaults)
     except IOError as ex:
         raise IOError(('Could not write the default preferences to a '
                        'file: %s' % str(ex)))
Exemple #16
0
    def run(self):
        # Make sure we first run the build (including running 2to3 for Python3)
        # and then import from the build directory
        build_py.run(self)
        sys.path.insert(0, self.build_lib)
        from brian2.core.preferences import brian_prefs

        # We generate the file directly in the build directory
        try:
            with open(
                    os.path.join(self.build_lib, 'brian2',
                                 'default_preferences'), 'wt') as f:
                defaults = brian_prefs.defaults_as_file
                f.write(defaults)
        except IOError as ex:
            raise IOError(('Could not write the default preferences to a '
                           'file: %s' % str(ex)))
Exemple #17
0
    def run(self):
        # Generate necessary .proto file if it doesn't exist.
        generate_proto("../src/google/protobuf/descriptor.proto")
        generate_proto("../src/google/protobuf/compiler/plugin.proto")
        generate_proto("../src/google/protobuf/any.proto")
        generate_proto("../src/google/protobuf/api.proto")
        generate_proto("../src/google/protobuf/duration.proto")
        generate_proto("../src/google/protobuf/empty.proto")
        generate_proto("../src/google/protobuf/field_mask.proto")
        generate_proto("../src/google/protobuf/source_context.proto")
        generate_proto("../src/google/protobuf/struct.proto")
        generate_proto("../src/google/protobuf/timestamp.proto")
        generate_proto("../src/google/protobuf/type.proto")
        generate_proto("../src/google/protobuf/wrappers.proto")
        GenerateUnittestProtos()

        # _build_py is an old-style class, so super() doesn't work.
        _build_py.run(self)
Exemple #18
0
  def run(self):
    # Generate necessary .proto file if it doesn't exist.
    generate_proto("../src/google/protobuf/descriptor.proto")
    generate_proto("../src/google/protobuf/compiler/plugin.proto")
    generate_proto("../src/google/protobuf/any.proto")
    generate_proto("../src/google/protobuf/api.proto")
    generate_proto("../src/google/protobuf/duration.proto")
    generate_proto("../src/google/protobuf/empty.proto")
    generate_proto("../src/google/protobuf/field_mask.proto")
    generate_proto("../src/google/protobuf/source_context.proto")
    generate_proto("../src/google/protobuf/struct.proto")
    generate_proto("../src/google/protobuf/timestamp.proto")
    generate_proto("../src/google/protobuf/type.proto")
    generate_proto("../src/google/protobuf/wrappers.proto")
    GenerateUnittestProtos()

    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #19
0
    def run(self):
        """ run the proto_builder """
        for package in self.packages:
            packagedir = self.get_package_dir(package)

            for protofile in filter(lambda x: x.endswith('.proto'),
                                    os.listdir(packagedir)):
                source = os.path.join(packagedir, protofile)
                output = source.replace('.proto', '_pb2.py')
                print(f"Generating {output}...")

                if (not os.path.exists(output) or \
                    (os.path.getmtime(source) > os.path.getmtime(output))):
                    protoc_command = [find_protoc(), \
                                      "--python_out=.", source]
                    if subprocess.call(protoc_command) != 0:
                        sys.exit(-1)
        _build_py.run(self)
Exemple #20
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
             if sys.version_info >= (3, 0):
                 # process manually python file in include_dirs (test data)
                 from distutils.util import run_2to3
                 print(('running 2to3 on', dest))
                 run_2to3([dest])
Exemple #21
0
    def run(self):
        # if 'build' was called explicitly, flag that requests etc. should be fetched
        if 'install' not in sys.argv:
            os.environ['ACTION'] = 'build'

        # compile the dependencies into build/lib/plotdevice/lib...
        self.spawn([sys.executable, 'app/deps/build.py', abspath(self.build_lib)])

        # ...then let the real build_py routine do its thing
        build_py.run(self)

        # include some ui resources for running a script from the command line
        rsrc_dir = '%s/plotdevice/rsrc'%self.build_lib
        self.mkpath(rsrc_dir)

        self.copy_file("app/Resources/colors.json", '%s/colors.json'%rsrc_dir)
        self.copy_file("app/Resources/PlotDeviceFile.icns", '%s/viewer.icns'%rsrc_dir)
        for dst, src in stale('%s/viewer.nib'%rsrc_dir, src="app/Resources/English.lproj/PlotDeviceScript.xib"):
            self.spawn(['/usr/bin/ibtool','--compile', dst, src])
Exemple #22
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
             if sys.version_info >= (3, 0):
                 # process manually python file in include_dirs (test data)
                 from subprocess import check_call
                 print('running 2to3 on', dest) # parens are NOT optional here for py3k compat
                 check_call(['2to3', '-wn', dest])
Exemple #23
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
             if sys.version_info >= (3, 0):
                 # process manually python file in include_dirs (test data)
                 from subprocess import check_call
                 print('running 2to3 on', dest) # parens are NOT optional here for py3k compat
                 check_call(['2to3', '-wn', dest])
Exemple #24
0
 def run(self):
     """overridden from install_lib class"""
     build_py.run(self)
     # manually install included directories if any
     if include_dirs:
         if subpackage_of:
             base = join(subpackage_of, modname)
         else:
             base = modname
         basedir = os.path.join(self.build_lib, base)
         for directory in include_dirs:
             dest = join(basedir, directory)
             shutil.rmtree(dest, ignore_errors=True)
             shutil.copytree(directory, dest)
             if sys.version_info >= (3, 0):
                 # process manually python file in include_dirs (test data)
                 from distutils.util import run_2to3
                 print('running 2to3 on', dest)
                 run_2to3([dest])
  def run(self):
    # generate .proto file
    protoc_1 = "./protoc_1"
    protoc_2 = "./protoc_2"
    generate_proto("protos/src/proto/google/protobuf/unittest.proto", protoc_2)
    generate_proto("protos/src/proto/google/protobuf/unittest_custom_options.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_import.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_import_public.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_mset.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_no_generic_services.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/factory_test1.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/factory_test2.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_extensions.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_extensions_dynamic.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_messages.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/test_bad_identifiers.proto", protoc_1)

    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #26
0
  def run(self):
    # generate .proto file
    protoc_1 = "./protoc_1"
    protoc_2 = "./protoc_2"
    generate_proto("protos/src/proto/google/protobuf/unittest.proto", protoc_2)
    generate_proto("protos/src/proto/google/protobuf/unittest_custom_options.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_import.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_import_public.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_mset.proto", protoc_1)
    generate_proto("protos/src/proto/google/protobuf/unittest_no_generic_services.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/factory_test1.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/factory_test2.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_extensions.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_extensions_dynamic.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/more_messages.proto", protoc_1)
    generate_proto("protos/python/google/protobuf/internal/test_bad_identifiers.proto", protoc_1)

    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #27
0
  def run(self):
    # Generate necessary .proto file if it doesn't exist.
    generate_proto("../src/machinetalk/protobuf/canon.proto")
    generate_proto("../src/machinetalk/protobuf/config.proto")
    generate_proto("../src/machinetalk/protobuf/emcclass.proto")
    generate_proto("../src/machinetalk/protobuf/log.proto")
    generate_proto("../src/machinetalk/protobuf/message.proto")
    generate_proto("../src/machinetalk/protobuf/motcmds.proto")
    generate_proto("../src/machinetalk/protobuf/nanopb.proto")
    generate_proto("../src/machinetalk/protobuf/object.proto")
    generate_proto("../src/machinetalk/protobuf/preview.proto")
    generate_proto("../src/machinetalk/protobuf/rtapi_message.proto")
    generate_proto("../src/machinetalk/protobuf/rtapicommand.proto")
    generate_proto("../src/machinetalk/protobuf/status.proto")
    generate_proto("../src/machinetalk/protobuf/task.proto")
    generate_proto("../src/machinetalk/protobuf/test.proto")
    generate_proto("../src/machinetalk/protobuf/types.proto")
    generate_proto("../src/machinetalk/protobuf/value.proto")

    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #28
0
  def run(self):
    # Generate necessary .proto file if it doesn't exist.
    generate_proto("../src/google/protobuf/descriptor.proto")
    generate_proto("../src/google/protobuf/compiler/plugin.proto")
    generate_proto("../src/google/protobuf/any.proto")
    generate_proto("../src/google/protobuf/api.proto")
    generate_proto("../src/google/protobuf/duration.proto")
    generate_proto("../src/google/protobuf/empty.proto")
    generate_proto("../src/google/protobuf/field_mask.proto")
    generate_proto("../src/google/protobuf/source_context.proto")
    generate_proto("../src/google/protobuf/struct.proto")
    generate_proto("../src/google/protobuf/timestamp.proto")
    generate_proto("../src/google/protobuf/type.proto")
    generate_proto("../src/google/protobuf/wrappers.proto")
    GenerateUnittestProtos()

    # Make sure google.protobuf/** are valid packages.
    for path in ['', 'internal/', 'compiler/', 'pyext/', 'util/']:
      try:
        open('google/protobuf/{0!s}__init__.py'.format(path), 'a').close()
      except EnvironmentError:
        pass
    # _build_py is an old-style class, so super() doesn't work.
    _build_py.run(self)
Exemple #29
0
 def run(self):
     build_py_2to3.run(self)
     print("copy/convert test suite")
     loglevel = log.set_threshold(log.ERROR)
     copydir_run_2to3("test", "test3", template=self.manifest_in)
     log.set_threshold(loglevel)
Exemple #30
0
 def run(self):
     self.run_command("build_qt")
     build_py.run(self)
Exemple #31
0
    def run(self):
        validate_version(version)

        generate_proto("./proto/src", "src/whylogs/proto")
        # _build_py is an old-style class, so super() doesn't work.
        _build_py.run(self)
Exemple #32
0
 def run(self):
     build_py.run(self)
     if use_separate_namespace:
         rename_crypto_dir(self.build_lib)
Exemple #33
0
 def run(self):
     self.run_command('build_ext')
     _build_py.run(self)
Exemple #34
0
 def run(self):
     build_py.run(self)
     if use_separate_namespace:
         rename_crypto_dir(self.build_lib)
Exemple #35
0
 def run(self):
     self.run_command('build_ext')
     _build_py.run(self)
Exemple #36
0
 def run(self):
     print_sysinfo()
     self.run_command("build_qt")
     build_py.run(self)
Exemple #37
0
 def run(self):
     build_src = self.get_finalized_command('build_src')
     if build_src.py_modules_dict and self.packages is None:
         self.packages = list(build_src.py_modules_dict.keys())
     old_build_py.run(self)