예제 #1
0
def main() -> None:
    try:
        _enable_cli_mode()
        _parse_args()

        config = get_config()

        pyproject_path = _get_pyproject_path()
        if pyproject_path is None:
            raise RuntimeError("Unable to find pyproject.toml")

        version = _get_version(config)[1]
        print("Version: {}".format(version), file=sys.stderr)
        name = _apply_version(version, config, pyproject_path)
        if _state.project(name).substitutions:
            print("Files with substitutions:", file=sys.stderr)
            for file_name in _state.project(name).substitutions:
                print("  - {}".format(file_name), file=sys.stderr)
        else:
            print("Files with substitutions: none", file=sys.stderr)
    except Exception as e:
        print("Error: {}".format(e), file=sys.stderr)
        sys.exit(1)
예제 #2
0
def test__get_config__with_plugin_customizations():
    config = plugin.get_config(root / "tests" / "project")
    assert config["vcs"] == "git"
    assert config["style"] == "semver"
    assert config["subversion"]["tag-dir"] == "alt/tags"
예제 #3
0
def test__get_config__without_plugin_customizations():
    config = plugin.get_config(root)
    assert config["vcs"] == "any"
    assert config["style"] is None
    assert config["subversion"]["tag-dir"] == "tags"