How to use the pyscaffold.shell.git function in PyScaffold

To help you get started, we’ve selected a few PyScaffold examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyscaffold / pyscaffold / tests / test_install.py View on Github external
def tag(self, name, message):
        with chdir(self.pkg_path):
            git("tag", "-a", name, "-m", message)
        return self
github pyscaffold / pyscaffold / tests / test_repo.py View on Github external
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))
github pyscaffold / pyscaffold / tests / test_install.py View on Github external
def make_commit(self):
        with chdir(self.pkg_path):
            git("commit", "-a", "-m", "message")
        return self
github pyscaffold / pyscaffold / tests / test_install.py View on Github external
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")
github pyscaffold / pyscaffold / tests / fixtures.py View on Github external
def nogit_mock():
    def raise_error(*_):
        raise CalledProcessError(1, "git", "No git mock!")

    old_git = shell.git
    shell.git = raise_error
    yield
    shell.git = old_git
github pyscaffold / pyscaffold / tests / fixtures.py View on Github external
def git_mock():
    def mock(*_):
        yield "git@mock"

    old_git = shell.git
    shell.git = mock
    yield
    shell.git = old_git
github pyscaffold / pyscaffold / tests / fixtures.py View on Github external
def nogit_mock():
    def raise_error(*_):
        raise CalledProcessError(1, "git", "No git mock!")

    old_git = shell.git
    shell.git = raise_error
    yield
    shell.git = old_git
github pyscaffold / pyscaffold / tests / fixtures.py View on Github external
def nogit_mock():
    def raise_error(*_):
        raise CalledProcessError(1, "git", "No git mock!")

    old_git = shell.git
    shell.git = raise_error
    yield
    shell.git = old_git
github pyscaffold / pyscaffold / tests / fixtures.py View on Github external
def git_mock():
    def mock(*_):
        yield "git@mock"

    old_git = shell.git
    shell.git = mock
    yield
    shell.git = old_git