How to use PyScaffold - 10 common examples

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 / extensions / test_pre_commit.py View on Github external
def test_create_project_without_pre_commit(tmpfolder):
    # Given options without the pre-commit extension,
    opts = dict(project="proj")

    # when the project is created,
    create_project(opts)

    # then pre-commit files should not exist
    assert not path_exists("proj/.pre-commit-config.yaml")
    assert not path_exists("proj/.isort.cfg")
github pyscaffold / pyscaffold / tests / test_install.py View on Github external
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"),
            )
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
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_get_git_root_with_nogit(tmpfolder, nogit_mock):
    project = "my_project"
    struct = {
        project: {
            "my_file": "Some other content",
            "my_dir": {"my_file": "Some more content"},
        }
    }
    structure.create_structure(struct, {})
    with utils.chdir(project):
        git_root = repo.get_git_root(default=".")
    assert git_root == "."
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 / test_api.py View on Github external
def test_get_default_opts_with_nogit(nogit_mock):
    with pytest.raises(GitNotInstalled):
        get_default_options({}, dict(project="my-project"))