Revert "clan-cli: deprecate nix_shell() in favor of run_cmd()"

This reverts commit 37e6ca7a30.
This commit is contained in:
Jörg Thalheim
2024-07-17 14:04:49 +02:00
parent 55fc9dd00d
commit 0d6e2539e3
24 changed files with 116 additions and 104 deletions

View File

@@ -4,7 +4,7 @@ from pathlib import Path
import pytest
from clan_cli.custom_logger import setup_logging
from clan_cli.nix import run_cmd
from clan_cli.nix import nix_shell
pytest_plugins = [
"temporary_dir",
@@ -32,12 +32,12 @@ def pytest_sessionstart(session: pytest.Session) -> None:
@pytest.fixture
def git_repo(tmp_path: Path) -> Path:
# initialize a git repository
cmd = run_cmd(["git"], ["git", "init"])
cmd = nix_shell(["nixpkgs#git"], ["git", "init"])
subprocess.run(cmd, cwd=tmp_path, check=True)
# set user.name and user.email
cmd = run_cmd(["git"], ["git", "config", "user.name", "test"])
cmd = nix_shell(["nixpkgs#git"], ["git", "config", "user.name", "test"])
subprocess.run(cmd, cwd=tmp_path, check=True)
cmd = run_cmd(["git"], ["git", "config", "user.email", "test@test.test"])
cmd = nix_shell(["nixpkgs#git"], ["git", "config", "user.email", "test@test.test"])
subprocess.run(cmd, cwd=tmp_path, check=True)
# return the path to the git repository
return tmp_path