Skip to content

Commit dc29c75

Browse files
fix: 🐛 Import Error when running from nox in woodpecker... (#58)
1 parent 01b5ebe commit dc29c75

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

codelimit/common/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from pathlib import Path
66
from typing import Union, Any
77

8+
import sh
89
from rich.style import Style
910
from rich.text import Text
10-
from sh import git, ErrorReturnCode
1111

1212
from codelimit.common.Configuration import Configuration
13-
from codelimit.common.Measurement import Measurement
1413
from codelimit.common.GithubRepository import GithubRepository
14+
from codelimit.common.Measurement import Measurement
1515
from codelimit.common.gsm.Expression import Expression
1616
from codelimit.common.gsm.operator.Operator import Operator
1717
from codelimit.common.token_matching.predicate.TokenValue import TokenValue
@@ -207,17 +207,17 @@ def replace_string_literal_with_predicate(expression: Expression) -> Expression:
207207

208208
def _get_git_branch(path: Path) -> str | None:
209209
try:
210-
out = git('rev-parse', '--abbrev-ref', 'HEAD', _cwd=path)
210+
out = sh.git('rev-parse', '--abbrev-ref', 'HEAD', _cwd=path)
211211
return out.strip()
212-
except ErrorReturnCode:
212+
except sh.ErrorReturnCode | sh.CommandNotFound:
213213
return None
214214

215215

216216
def _get_remote_url(path: Path) -> str | None:
217217
try:
218-
out = git('config', '--get', 'remote.origin.url', _cwd=path)
218+
out = sh.git('config', '--get', 'remote.origin.url', _cwd=path)
219219
return out.strip()
220-
except ErrorReturnCode:
220+
except sh.ErrorReturnCode | sh.CommandNotFound:
221221
return None
222222

223223

0 commit comments

Comments
 (0)