def test_simple_from_file(self): fid, filename = tempfile.mkstemp(suffix=".info", text=True) try: os.write(fid, self.simple_text.encode()) opts = PackageOptions.from_file(filename) self._test_simple(opts) finally: os.close(fid) os.remove(filename)
def __init__(self, attrs=None): if attrs is None: attrs = {} if not "bento_info" in attrs: bento_info = "bento.info" else: bento_info = attrs["bento.info"] self.pkg = PackageDescription.from_file(bento_info) package_options = PackageOptions.from_file(bento_info) attrs = _setup_cmd_classes(attrs) d = pkg_to_distutils_meta(self.pkg) attrs.update(d) Distribution.__init__(self, attrs) self.packages = self.pkg.packages self.py_modules = self.pkg.py_modules if hasattr(self, "entry_points"): if self.entry_points is None: self.entry_points = {} console_scripts = [ e.full_representation() for e in self.pkg.executables.values() ] if "console_scripts" in self.entry_points: self.entry_points["console_scripts"].extend(console_scripts) else: self.entry_points["console_scripts"] = console_scripts source_root = os.getcwd() build_root = os.path.join(source_root, "build") root = create_root_with_source_tree(source_root, build_root) self.top_node = root._ctx.srcnode self.build_node = root._ctx.bldnode self.run_node = root._ctx.srcnode self.global_context = global_context_factory(package_options) mods = set_main(self.pkg, self.top_node, self.build_node) self._setup_hooks(self.pkg, self.global_context, mods)
def __init__(self, attrs=None): if attrs is None: attrs = {} if not "bento_info" in attrs: bento_info = "bento.info" else: bento_info = attrs["bento.info"] self.pkg = PackageDescription.from_file(bento_info) self.package_options = PackageOptions.from_file(bento_info) attrs = _setup_cmd_classes(attrs) d = pkg_to_distutils_meta(self.pkg) attrs.update(d) Distribution.__init__(self, attrs) self.packages = self.pkg.packages self.py_modules = self.pkg.py_modules if hasattr(self, "entry_points"): if self.entry_points is None: self.entry_points = {} console_scripts = [e.full_representation() for e in self.pkg.executables.values()] if "console_scripts" in self.entry_points: self.entry_points["console_scripts"].extend(console_scripts) else: self.entry_points["console_scripts"] = console_scripts source_root = os.getcwd() build_root = os.path.join(source_root, "build") root = create_root_with_source_tree(source_root, build_root) self.top_node = root._ctx.srcnode self.build_node = root._ctx.bldnode self.run_node = root._ctx.srcnode self.global_context = global_context_factory(self.package_options) modules = set_main(self.top_node, self.build_node, self.pkg)