@@ -120,26 +120,22 @@ def support_package_url(self, support_revision: str) -> str:
120120 f"{ self .support_package_filename (support_revision )} "
121121 )
122122
123- def stub_binary_filename (self , support_revision : str , is_console_app : bool ) -> str :
123+ def stub_binary_filename (
124+ self ,
125+ support_revision : str ,
126+ app : FinalizedAppConfig ,
127+ ) -> str :
124128 """The filename for the stub binary."""
125- stub_type = "Console" if is_console_app else "GUI"
126- win_suffix = (
127- f"-{ self .tools .host_arch .lower ()} "
128- if self .tools .host_os == "Windows"
129- else ""
130- )
131- return (
132- f"{ stub_type } -Stub-{ self .python_version_tag } { win_suffix } "
133- f"-b{ support_revision } .zip"
134- )
129+ stub_type = "Console" if app .console_app else "GUI"
130+ return f"{ stub_type } -Stub-{ self .python_version_tag } -b{ support_revision } .zip"
135131
136- def stub_binary_url (self , support_revision : str , is_console_app : bool ) -> str :
132+ def stub_binary_url (self , support_revision : str , app : FinalizedAppConfig ) -> str :
137133 """The URL of the stub binary to use for apps of this type."""
138134 return (
139135 "https://briefcase-support.s3.amazonaws.com/python/"
140136 f"{ self .python_version_tag } /"
141137 f"{ self .platform } /"
142- f"{ self .stub_binary_filename (support_revision , is_console_app )} "
138+ f"{ self .stub_binary_filename (support_revision , app )} "
143139 )
144140
145141 def icon_targets (self , app : FinalizedAppConfig ):
@@ -296,15 +292,14 @@ def app_environment(
296292 app : FinalizedAppConfig ,
297293 host_arch : str | None = None ,
298294 ) -> dict [str , VirtualEnvironment ]:
299- """Create an isolated virtual environment for the."""
295+ """Create an isolated virtual environment in which the app can be built ."""
300296 if host_arch is None :
301297 host_arch = self .tools .host_arch
302298
303- env_name = f"{ app .env_manager } -{ self .tools . host_os } -{ self .tools .host_arch } "
304- venv = self .tools .virtual_environment (
305- env_manager = app . env_manager ,
299+ env_name = f"{ app .env_manager } -{ self .platform } -{ self .tools .host_arch } "
300+ venv = self .tools .virtual_environment [ app . env_manager ] (
301+ tools = self . tools ,
306302 venv_path = self .base_path / ".briefcase/" / app .app_name / env_name ,
307- isolated = True ,
308303 platform = self .platform ,
309304 arch = host_arch ,
310305 )
@@ -510,9 +505,7 @@ def _download_stub_binary(self, app: FinalizedAppConfig) -> Path:
510505 except AttributeError :
511506 stub_binary_revision = self .stub_binary_revision (app )
512507
513- stub_binary_url = self .stub_binary_url (
514- stub_binary_revision , app .console_app
515- )
508+ stub_binary_url = self .stub_binary_url (stub_binary_revision , app = app )
516509 custom_stub_binary = False
517510 self .console .info (f"Using stub binary { stub_binary_url } " )
518511
@@ -947,6 +940,7 @@ def create_app(self, app: FinalizedAppConfig, **options):
947940 prefix = app .app_name ,
948941 )
949942 else :
943+ self .console .info ("Creating app environment..." , prefix = app .app_name )
950944 venv = self .app_environment (app = app )
951945
952946 if not venv .provides_python :
@@ -983,7 +977,7 @@ def create_app(self, app: FinalizedAppConfig, **options):
983977 self .console .info (
984978 "Installing managed Python environment..." , prefix = app .app_name
985979 )
986- self .install_managed_python_env (app = app )
980+ self .install_managed_python_env (app = app , venv = venv )
987981
988982 self .console .info ("Removing unneeded app content..." , prefix = app .app_name )
989983 self .cleanup_app_content (app = app )
0 commit comments