Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/extra_script.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib
import re
import subprocess
Expand All @@ -18,9 +19,15 @@ def main() -> None:
]:
return

Import("env")
env: Environment = typing.cast(Environment, globals()["env"])

uv_env = os.environ.copy()
uv_env["VIRTUAL_ENV"] = os.path.join(env.subst("$PROJECT_CORE_DIR"), "penv")
uv = subprocess.run(
[sys.executable, "-m", "uv", "sync", "--active", "--inexact", "--only-group", "scripts"],
stderr=subprocess.DEVNULL,
env=uv_env,
)
if uv.returncode:
match = re.search(r'"(uv==\d+\.\d+\.\d+)"', pathlib.Path("pyproject.toml").read_text())
Expand All @@ -31,10 +38,8 @@ def main() -> None:
if pip.returncode:
subprocess.run([sys.executable, "-m", "ensurepip"], check=True)
subprocess.run(pip.args, check=True)
subprocess.run(uv.args, check=True)
subprocess.run(uv.args, env=uv_env, check=True)

Import("env")
env: Environment = typing.cast(Environment, globals()["env"])
from src.Frekvens import Frekvens # noqa: E402

if env.IsCleanTarget():
Expand Down
6 changes: 6 additions & 0 deletions scripts/src/components/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ def GetProjectOption(self, option: str, default: typing.Any = None) -> typing.An
def IsCleanTarget(self) -> bool:
raise NotImplementedError

def Replace(self, **kwargs: typing.Any) -> None:
raise NotImplementedError

def StringifyMacro(self, value: str) -> str:
raise NotImplementedError

def subst(self, key: str) -> str:
raise NotImplementedError


def Import(*vars: str) -> None:
raise NotImplementedError
Loading