From 396960fae06506d14b8361708e82ea2c9735e92e Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Tue, 27 Dec 2022 20:20:52 -0800 Subject: [PATCH] Only import toml and gitpython when necessary Allows for using most commands on platforms without git installed (like the a-shell app on ios where gitpython doesnt quite work) --- yaclog/cli/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaclog/cli/__main__.py b/yaclog/cli/__main__.py index ec804ad..eb09d42 100644 --- a/yaclog/cli/__main__.py +++ b/yaclog/cli/__main__.py @@ -16,10 +16,8 @@ import datetime import os.path -from ..cli import cargo_toml import click -import git import yaclog.version from yaclog.changelog import Changelog @@ -254,10 +252,12 @@ def release(obj: Changelog, version_name, rel_seg, pre_seg, commit, cargo): short_version = cur_version.name.replace(' ', '-') if cargo: + from ..cli import cargo_toml cargo_toml.set_version("Cargo.toml", str(short_version)) click.echo("Updated Cargo.toml") if commit: + import git repo = git.Repo(os.curdir) if repo.bare: