@@ -87,6 +87,10 @@ def _process_requirement_line(
8787 ignored_req_map : dict ,
8888 tmp_file ,
8989 target_env_for_markers : dict [str , str ],
90+ run_now : bool = False ,
91+ venv_dir : Path | None = None ,
92+ verbose : bool = False ,
93+ dry_run : bool = False ,
9094) -> bool :
9195 req_line = req_line .strip ()
9296 if not req_line or req_line .startswith ("#" ):
@@ -110,6 +114,14 @@ def _process_requirement_line(
110114
111115 if should_ignore :
112116 return False
117+ elif run_now :
118+ _run_command (
119+ ["uv" , "pip" , "install" , valid_line ],
120+ venv_dir = venv_dir ,
121+ verbose = verbose ,
122+ dry_run = dry_run ,
123+ )
124+ return True
113125 else :
114126 tmp_file .write (valid_line + "\n " )
115127 return True
@@ -182,20 +194,7 @@ def create_odoo_venv( # noqa: C901
182194 f" ✔ Virtual environment created at { typer .style (str (venv_dir ), fg = typer .colors .YELLOW )} " ,
183195 )
184196
185- # 3. Install Odoo in editable mode
186- if install_odoo :
187- typer .secho ("\n Installing Odoo in editable mode..." )
188- _run_command (
189- ["uv" , "pip" , "install" , "-e" , f"file://{ odoo_dir } #egg=odoo" ],
190- venv_dir = venv_dir ,
191- verbose = verbose ,
192- dry_run = dry_run ,
193- )
194- typer .secho (
195- " ✔ Installed Odoo in editable mode" ,
196- )
197-
198- # 4. Install requirements
197+ # 3. Install requirements
199198 all_req_files = []
200199 if install_odoo_requirements :
201200 odoo_reqs_file = odoo_dir / "requirements.txt"
@@ -245,7 +244,16 @@ def create_odoo_venv( # noqa: C901
245244
246245 if extra_requirements :
247246 for req_line in extra_requirements :
248- if _process_requirement_line (req_line , ignored_req_map , tmp , target_env_for_markers ):
247+ if _process_requirement_line (
248+ req_line ,
249+ ignored_req_map ,
250+ tmp ,
251+ target_env_for_markers ,
252+ run_now = True ,
253+ venv_dir = venv_dir ,
254+ verbose = verbose ,
255+ dry_run = dry_run ,
256+ ):
249257 req_count += 1
250258
251259 if extra_requirements_file :
@@ -301,6 +309,19 @@ def create_odoo_venv( # noqa: C901
301309 _run_command (install_args , venv_dir = venv_dir , verbose = False , dry_run = dry_run )
302310 typer .secho (f" ✔ { typer .style (req_count , fg = typer .colors .YELLOW )} Packages installed successfully" )
303311
312+ # 4. Install Odoo in editable mode
313+ if install_odoo :
314+ typer .secho ("\n Installing Odoo in editable mode..." )
315+ _run_command (
316+ ["uv" , "pip" , "install" , "-e" , f"file://{ odoo_dir } #egg=odoo" ],
317+ venv_dir = venv_dir ,
318+ verbose = verbose ,
319+ dry_run = dry_run ,
320+ )
321+ typer .secho (
322+ " ✔ Installed Odoo in editable mode" ,
323+ )
324+
304325 os .remove (tmp_path )
305326
306327 typer .secho ("\n ✅ Environment setup complete!" , fg = typer .colors .GREEN )
0 commit comments