def setup(self, pydmt: PyDMT) -> None: if os.path.isfile("Makefile"): pydmt.add_builder( BuilderMake( source="Makefile", target="out/make.stamp", ))
def setup(self, pydmt: PyDMT) -> None: if not os.path.isfile(SOURCE_FILE): return builder = BuilderReqs( source=SOURCE_FILE, target=TARGET_FILE, ) pydmt.add_builder(builder)
def test06Fail(self): with tempdir(): shutil.copy("/etc/passwd", "passwd") p = PyDMT() b = Fail("passwd", "copy_of_passwd") p.add_builder(b) stats = p.build_all() self.assertEqual(stats.get_builder_ok(), 0) self.assertEqual(stats.get_builder_fail(), 1) self.assertEqual(stats.get_copy_missing(), 0) self.assertEqual(stats.get_nop(), 0)
def build(): add_to_path() pylogconf.core.setup() p = PyDMT() logger = logging.getLogger(LOGGER_NAME) logger.setLevel(ConfigLogging.loglevel) add_all_features(p) stats = p.build_all() sys.exit(stats.get_os_error_code())
def clean() -> None: add_to_path() pylogconf.core.setup() p = PyDMT() logger = logging.getLogger(LOGGER_NAME) logger.setLevel(ConfigLogging.loglevel) add_all_features(p) shutil.rmtree(".pydmt") p.clean_all()
def setup(self, pydmt: PyDMT) -> None: if not os.path.isdir(self.yaml_folder): return for root, _, filenames in os.walk(self.yaml_folder): for filename in filenames: source = os.path.join(root, filename) target_base, ext = os.path.splitext(source) if ext == ".yaml": target = os.sep.join([self.validation_folder, target_base, source + ".stamp"]) builder = BuilderYaml( source=source, target=target, ) pydmt.add_builder(builder)
def setup(self, pydmt: PyDMT) -> None: if not os.path.isdir(self.templates_folder): return for root, _, filenames in os.walk(self.templates_folder): for filename in filenames: source = os.path.join(root, filename) target_base, ext = os.path.splitext(source) if ext == '.mako': target = os.sep.join(target_base.split(os.sep)[1:]) builder = BuilderMako( source=source, target=target, data=self.data, config_files=files_under_folder(self.config_folder, suffix=".py"), snipplet_files=files_under_folder(self.snipplet_folder, suffix=".mako"), ) pydmt.add_builder(builder)
def test05CopyAfterRemove(self): with tempdir(): shutil.copy("/etc/passwd", "passwd") p = PyDMT() b = Copy("passwd", "copy_of_passwd") p.add_builder(b) p.build_all() os.unlink("copy_of_passwd") stats = p.build_all() self.assertEqual(stats.get_builder_ok(), 0) self.assertEqual(stats.get_builder_fail(), 0) self.assertEqual(stats.get_nop(), 0) self.assertEqual(stats.get_copy_missing(), 1)
def setup(self, pydmt: PyDMT) -> None: if not os.path.isdir(SPHINX_FOLDER): return pydmt.add_builder(BuilderSphinx())
def get_std_test(): shutil.copy("/etc/passwd", "passwd") p = PyDMT() b = Copy("passwd", "copy_of_passwd") p.add_builder(b) return p.build_all()
def test02ReturnType(self): p = PyDMT() stats = p.build_all() self.assertIsInstance(stats, BuildProcessStats, "must be BuildProcessStats")
def test01NullBuild(self): p = PyDMT() p.build_all()
def setup(self, pydmt: PyDMT) -> None: if os.path.isfile("config/python.py"): pydmt.add_builder(BuilderVenv( source="config/python.py", target="out/python.stamp", ))
def setup(self, pydmt: PyDMT) -> None: if self.packages is not None: pydmt.add_builder( BuilderApt(source="config/deps.py", target="out/deps.stamp", packages=self.packages))
def test00CreatePyDMT(self): PyDMT()
def setup(self, pydmt: PyDMT) -> None: if not os.path.isfile("config/python.py"): return pydmt.add_builder(BuilderVenvFull())
def setup(self, pydmt: PyDMT) -> None: if os.path.isfile("package.json"): pydmt.add_builder(Installer( source="package.json", target="out/npm.stamp", ))