def _generate(self): putup([self.name]) with chdir(self.name): demoapp_src_dir = __location__ / self.name demoapp_dst_root = self.pkg_path demoapp_dst_pkg = demoapp_dst_root / "src" / self.name copyfile(demoapp_src_dir / "runner.py", demoapp_dst_pkg / "runner.py") git("add", demoapp_dst_pkg / "runner.py") for file in "setup.cfg setup.py pyproject.toml".split(): copyfile(demoapp_src_dir / file, demoapp_dst_root / file) git("add", demoapp_dst_root / file) if self.data: data_src_dir = demoapp_src_dir / "data" data_dst_dir = demoapp_dst_pkg / "data" os.mkdir(data_dst_dir) pkg_file = data_dst_dir / "__init__.py" pkg_file.write_text("") git("add", pkg_file) for file in "hello_world.txt".split(): copyfile(data_src_dir / file, data_dst_dir / file) git("add", data_dst_dir / file) git("commit", "-m", "Added basic application logic") # this is needed for Windows 10 which lacks some certificates self.run("pip", "install", "-q", "certifi")
def _generate(self): putup([self.name]) with chdir(self.name): demoapp_src_dir = path_join(__location__, self.name) demoapp_dst_root = self.pkg_path demoapp_dst_pkg = path_join(demoapp_dst_root, "src", self.name) copyfile( path_join(demoapp_src_dir, "runner.py"), path_join(demoapp_dst_pkg, "runner.py"), ) git("add", path_join(demoapp_dst_pkg, "runner.py")) copyfile( path_join(demoapp_src_dir, "setup.cfg"), path_join(demoapp_dst_root, "setup.cfg"), ) copyfile( path_join(demoapp_src_dir, "setup.py"), path_join(demoapp_dst_root, "setup.py"), ) git("add", path_join(demoapp_dst_root, "setup.cfg")) git("add", path_join(demoapp_dst_root, "setup.py")) if self.data: data_src_dir = path_join(demoapp_src_dir, "data") data_dst_dir = path_join(demoapp_dst_pkg, "data") os.mkdir(data_dst_dir) copyfile( path_join(data_src_dir, "hello_world.txt"), path_join(data_dst_dir, "hello_world.txt"), ) git("add", path_join(data_dst_dir, "hello_world.txt")) git("commit", "-m", "Added basic application logic") # this is needed for Windows 10 which lacks some certificats self.run("pip", "install", "-q", "certifi")
def create_demoapp(data=False): if data: demoapp = 'demoapp_data' else: demoapp = 'demoapp' putup([demoapp]) with chdir(demoapp): demoapp_src_dir = os.path.join(__location__, demoapp) demoapp_dst_root = os.getcwd() demoapp_dst_pkg = os.path.join(demoapp_dst_root, 'src', demoapp) copyfile(os.path.join(demoapp_src_dir, 'runner.py'), os.path.join(demoapp_dst_pkg, 'runner.py')) git('add', os.path.join(demoapp_dst_pkg, 'runner.py')) copyfile(os.path.join(demoapp_src_dir, 'setup.cfg'), os.path.join(demoapp_dst_root, 'setup.cfg')) copyfile(os.path.join(demoapp_src_dir, 'setup.py'), os.path.join(demoapp_dst_root, 'setup.py')) git('add', os.path.join(demoapp_dst_root, 'setup.cfg')) git('add', os.path.join(demoapp_dst_root, 'setup.py')) if data: data_src_dir = os.path.join(demoapp_src_dir, 'data') data_dst_dir = os.path.join(demoapp_dst_pkg, 'data') os.mkdir(data_dst_dir) copyfile(os.path.join(data_src_dir, 'hello_world.txt'), os.path.join(data_dst_dir, 'hello_world.txt')) git('add', os.path.join(data_dst_dir, 'hello_world.txt')) git('commit', '-m', 'Added basic application logic')
def _generate(self): putup([self.name]) with chdir(self.name): demoapp_src_dir = path_join(__location__, self.name) demoapp_dst_root = self.pkg_path demoapp_dst_pkg = path_join(demoapp_dst_root, 'src', self.name) copyfile(path_join(demoapp_src_dir, 'runner.py'), path_join(demoapp_dst_pkg, 'runner.py')) git('add', path_join(demoapp_dst_pkg, 'runner.py')) copyfile(path_join(demoapp_src_dir, 'setup.cfg'), path_join(demoapp_dst_root, 'setup.cfg')) copyfile(path_join(demoapp_src_dir, 'setup.py'), path_join(demoapp_dst_root, 'setup.py')) git('add', path_join(demoapp_dst_root, 'setup.cfg')) git('add', path_join(demoapp_dst_root, 'setup.py')) if self.data: data_src_dir = path_join(demoapp_src_dir, 'data') data_dst_dir = path_join(demoapp_dst_pkg, 'data') os.mkdir(data_dst_dir) copyfile(path_join(data_src_dir, 'hello_world.txt'), path_join(data_dst_dir, 'hello_world.txt')) git('add', path_join(data_dst_dir, 'hello_world.txt')) git('commit', '-m', 'Added basic application logic') # this is needed for Windows 10 which lacks some certificats self.run('pip', 'install', '-q', 'certifi')
def _generate(self): putup([self.name]) with chdir(self.name): demoapp_src_dir = path_join(__location__, self.name) demoapp_dst_root = self.pkg_path demoapp_dst_pkg = path_join(demoapp_dst_root, 'src', self.name) copyfile(path_join(demoapp_src_dir, 'runner.py'), path_join(demoapp_dst_pkg, 'runner.py')) git('add', path_join(demoapp_dst_pkg, 'runner.py')) copyfile(path_join(demoapp_src_dir, 'setup.cfg'), path_join(demoapp_dst_root, 'setup.cfg')) copyfile(path_join(demoapp_src_dir, 'setup.py'), path_join(demoapp_dst_root, 'setup.py')) git('add', path_join(demoapp_dst_root, 'setup.cfg')) git('add', path_join(demoapp_dst_root, 'setup.py')) if self.data: data_src_dir = path_join(demoapp_src_dir, 'data') data_dst_dir = path_join(demoapp_dst_pkg, 'data') os.mkdir(data_dst_dir) copyfile(path_join(data_src_dir, 'hello_world.txt'), path_join(data_dst_dir, 'hello_world.txt')) git('add', path_join(data_dst_dir, 'hello_world.txt')) git('commit', '-m', 'Added basic application logic')