1111from .apptemplate import TemplateFile , AppTemplate
1212from .exceptions import AppMakerException
1313from .helpers .vcs import VcsHelper
14+ from .helpers .venvs import VenvHelper
1415from .rendering import Renderer
1516from .utils import chdir , configure_logging , PYTHON_VERSION
1617
@@ -276,9 +277,11 @@ def _hook_run(self, hook_name: str) -> Dict[AppTemplate, bool]:
276277
277278 def rollout (
278279 self ,
279- dest : str , * ,
280+ dest : str ,
281+ * ,
280282 overwrite : bool = False ,
281283 init_repository : bool = False ,
284+ init_venv : bool = False ,
282285 remote_address : str = None ,
283286 remote_push : bool = False
284287 ):
@@ -290,6 +293,8 @@ def rollout(
290293
291294 :param init_repository: Whether to initialize a repository.
292295
296+ :param init_venv: Whether to initialize a virtual environment.
297+
293298 :param remote_address: Remote repository address to add to DVCS.
294299
295300 :param remote_push: Whether to push to remote.
@@ -338,12 +343,15 @@ def rollout(
338343 with chdir (dest ):
339344 self ._hook_run ('rollout_post' )
340345
341- if init_repository :
342- self ._vcs_init (
343- dest ,
344- add_files = bool (files .keys ()),
345- remote_address = remote_address ,
346- remote_push = remote_push )
346+ if init_venv :
347+ VenvHelper (dest ).initialize ()
348+
349+ if init_repository :
350+ self ._vcs_init (
351+ dest ,
352+ add_files = bool (files .keys ()),
353+ remote_address = remote_address ,
354+ remote_push = remote_push )
347355
348356 @staticmethod
349357 def _comment_out (text : Optional [str ]) -> Optional [str ]:
0 commit comments