Skip to content

Commit

Permalink
chore: auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 20, 2025
1 parent 63be515 commit 3b1204f
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions tools/smoke.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from tempfile import TemporaryDirectory
from pathlib import Path
import hashlib
import logging
from subprocess import run
import os
from pathlib import Path
from subprocess import run
from tempfile import TemporaryDirectory

logging.basicConfig(level=logging.DEBUG,
format= '%(levelname)s: %(message)s',

)
logging.basicConfig(
level=logging.DEBUG,
format="%(levelname)s: %(message)s",
)
parent_project_dir = Path(__file__).parent.parent.resolve().as_posix()
with TemporaryDirectory(delete=False) as tmp_dir:
checksum = hashlib.sha256(parent_project_dir.encode("utf-8")).hexdigest()[:4]
Expand All @@ -27,13 +27,27 @@
run(["git", "-C", project_dir, "pull"], check=True)
else:
project_dir.mkdir(parents=True, exist_ok=True)
run(["git", "clone", "--recursive", f"https://github.com/ansible/{project}", project_dir], check=True)
run(
[
"git",
"clone",
"--recursive",
f"https://github.com/ansible/{project}",
project_dir,
],
check=True,
)

os.chdir(project_dir)
venv_dir = (project_dir / ".venv").as_posix()
os.environ["VIRTUAL_ENV"] = venv_dir
run(["uv", "venv", "--seed", venv_dir], check=True) # creates .venv (implicit for next commands)
run(["uv", "pip", "install", "-e", f"{parent_project_dir}[test]", "-e", ".[test]"], check=True)
run(
["uv", "venv", "--seed", venv_dir], check=True
) # creates .venv (implicit for next commands)
run(
["uv", "pip", "install", "-e", f"{parent_project_dir}[test]", "-e", ".[test]"],
check=True,
)
run(["uv", "pip", "freeze"], check=True)
run(["uv", "run", "pytest", "-n", "auto"], check=True)

Expand Down

0 comments on commit 3b1204f

Please sign in to comment.