Skip to content
Snippets Groups Projects
Commit cbaaffc7 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

enable editable installs

parent 12a180f4
No related merge requests found
Pipeline #77366 failed with stages
in 17 minutes and 29 seconds
......@@ -18,7 +18,7 @@ class VenvState:
main_requirements_file: str | None = None
initialized: bool = False
user_requirements: list[str] = field(default_factory=list)
user_requirements: list[list[str]] = field(default_factory=list)
user_requirements_hash: str | None = None
@property
......@@ -95,8 +95,7 @@ def action_require(args):
if not state.initialized:
raise RuntimeError("Virtual environment is not initialized.")
for req in args.requirements:
state.user_requirements.append(req)
state.user_requirements.append(list(args.requirements))
def action_populate(args):
......@@ -105,7 +104,7 @@ def action_populate(args):
with VenvState.lock(statefile) as state:
h = hashlib.sha256()
for req in state.user_requirements:
h.update(bytes(req, encoding="utf8"))
h.update(bytes(";".join(str(r) for r in req), encoding="utf8"))
digest = h.hexdigest()
if digest != state.user_requirements_hash:
......@@ -119,7 +118,7 @@ def action_populate(args):
pip_args = [str(state.venv_python), "-m", "pip", "install"]
for req in state.user_requirements:
install_args = pip_args.copy() + [req]
install_args = pip_args.copy() + req
subprocess.run(install_args).check_returncode()
state.user_requirements_hash = digest
......
......@@ -120,6 +120,7 @@ function(walberla_codegen_venv_require)
COMMAND
$CACHE{_WALBERLA_CODEGEN_VENV_INVOKE_MANAGER}
require
--
${ARGV}
RESULT_VARIABLE _lastResult
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment