File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -290,18 +290,30 @@ def configure_env(
290
290
291
291
io = event .io
292
292
poetry = command .poetry
293
+
293
294
executable = None
295
+ find_compatible = None
294
296
297
+ # add on option to trigger this
295
298
with contextlib .suppress (CalledProcessError ):
296
299
executable = decode (
297
300
subprocess .check_output (
298
- list_to_shell_command (["pyenv" , "which" , "python" ]),
301
+ list_to_shell_command (
302
+ [
303
+ "python" ,
304
+ "-c" ,
305
+ '"import sys; print(sys.executable)"' ,
306
+ ]
307
+ ),
299
308
shell = True ,
300
309
).strip ()
301
310
)
311
+ find_compatible = True
302
312
303
313
env_manager = EnvManager (poetry )
304
- env = env_manager .create_venv (io , executable = executable )
314
+ env = env_manager .create_venv (
315
+ io , executable = executable , find_compatible = find_compatible
316
+ )
305
317
306
318
if env .is_venv () and io .is_verbose ():
307
319
io .write_line (f"Using virtualenv: <comment>{ env .path } </>" )
Original file line number Diff line number Diff line change @@ -775,6 +775,7 @@ def create_venv(
775
775
name : Optional [str ] = None ,
776
776
executable : Optional [str ] = None ,
777
777
force : bool = False ,
778
+ find_compatible : Optional [bool ] = None ,
778
779
) -> Union ["SystemEnv" , "VirtualEnv" ]:
779
780
if self ._env is not None and not force :
780
781
return self ._env
@@ -828,7 +829,7 @@ def create_venv(
828
829
# If an executable has been specified, we stop there
829
830
# and notify the user of the incompatibility.
830
831
# Otherwise, we try to find a compatible Python version.
831
- if executable :
832
+ if executable and not find_compatible :
832
833
raise NoCompatiblePythonVersionFound (
833
834
self ._poetry .package .python_versions , python_patch
834
835
)
You can’t perform that action at this time.
0 commit comments