Ejemplo n.º 1
0
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')
Ejemplo n.º 2
0
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')
Ejemplo n.º 3
0
 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')
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
 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")
Ejemplo n.º 6
0
def test_is_git_repo(tmpfolder):
    assert not repo.is_git_repo('/a-folder/that-not/exist')
    newdir = tmpfolder.join('new').ensure_dir()
    assert not repo.is_git_repo(str(newdir))
    newdir.chdir()
    shell.git('init')
    tmpfolder.chdir()
    assert repo.is_git_repo(str(newdir))
Ejemplo n.º 7
0
def test_is_git_repo(tmpfolder):
    assert not repo.is_git_repo("/a-folder/that-not/exist")
    newdir = tmpfolder.join("new").ensure_dir()
    assert not repo.is_git_repo(str(newdir))
    newdir.chdir()
    shell.git("init")
    tmpfolder.chdir()
    assert repo.is_git_repo(str(newdir))
Ejemplo n.º 8
0
def test_is_git_repo(tmpfolder):
    assert not repo.is_git_repo('/a-folder/that-not/exist')
    newdir = tmpfolder.join('new').ensure_dir()
    assert not repo.is_git_repo(str(newdir))
    newdir.chdir()
    shell.git('init')
    tmpfolder.chdir()
    assert repo.is_git_repo(str(newdir))
Ejemplo n.º 9
0
def build_demoapp(dist, path=None, demoapp='demoapp'):
    if path is None:
        path = os.getcwd()
    path = os.path.join(path, demoapp)
    with chdir(path):
        if dist == 'git_archive':
            os.mkdir('dist')
            filename = os.path.join('dist', '{}.tar.gz'.format(demoapp))
            git('archive', '--format', 'tar.gz', '--output', filename,
                '--prefix', '{}_unpacked/'.format(demoapp), 'HEAD')
        else:
            setup_py(dist)
Ejemplo n.º 10
0
 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')
Ejemplo n.º 11
0
 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')
Ejemplo n.º 12
0
 def make_commit(self):
     with chdir(self.pkg_path):
         git('commit', '-a', '-m', 'message')
     return self
Ejemplo n.º 13
0
 def tag(self, name, message):
     with chdir(self.pkg_path):
         git("tag", "-a", name, "-m", message)
     return self
Ejemplo n.º 14
0
 def make_commit(self):
     with chdir(self.pkg_path):
         git("commit", "-a", "-m", "message")
     return self
Ejemplo n.º 15
0
 def tag(self, name, message):
     with chdir(self.pkg_path):
         git('tag', '-a', name, '-m', message)
     return self
Ejemplo n.º 16
0
 def make_commit(self):
     with chdir(self.pkg_path):
         git('commit', '-a', '-m', 'message')
     return self
Ejemplo n.º 17
0
def make_commit(demoapp='demoapp'):
    with chdir(demoapp):
        git('commit', '-a', '-m', 'message')
Ejemplo n.º 18
0
 def tag(self, name, message):
     with chdir(self.pkg_path):
         git('tag', '-a', name, '-m', message)
     return self
Ejemplo n.º 19
0
def make_commit(demoapp='demoapp'):
    with chdir(demoapp):
        git('commit', '-a', '-m', 'message')