Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
5b17d708
Commit
5b17d708
authored
Nov 30, 2021
by
finswimmer
Committed by
Bjorn Neergaard
Jan 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proof of concept to detect current running python through pyenv
parent
7058a492
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
+15
-1
src/poetry/console/application.py
+15
-1
No files found.
src/poetry/console/application.py
View file @
5b17d708
import
contextlib
import
logging
import
logging
import
re
import
re
import
subprocess
from
contextlib
import
suppress
from
contextlib
import
suppress
from
importlib
import
import_module
from
importlib
import
import_module
from
subprocess
import
CalledProcessError
from
typing
import
TYPE_CHECKING
from
typing
import
TYPE_CHECKING
from
typing
import
Any
from
typing
import
Any
from
typing
import
Callable
from
typing
import
Callable
...
@@ -21,6 +24,8 @@ from poetry.core.utils._compat import PY37
...
@@ -21,6 +24,8 @@ from poetry.core.utils._compat import PY37
from
poetry.__version__
import
__version__
from
poetry.__version__
import
__version__
from
poetry.console.command_loader
import
CommandLoader
from
poetry.console.command_loader
import
CommandLoader
from
poetry.console.commands.command
import
Command
from
poetry.console.commands.command
import
Command
from
poetry.utils._compat
import
decode
from
poetry.utils._compat
import
list_to_shell_command
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
...
@@ -281,9 +286,18 @@ class Application(BaseApplication):
...
@@ -281,9 +286,18 @@ class Application(BaseApplication):
io
=
event
.
io
io
=
event
.
io
poetry
=
command
.
poetry
poetry
=
command
.
poetry
executable
=
None
with
contextlib
.
suppress
(
CalledProcessError
):
executable
=
decode
(
subprocess
.
check_output
(
list_to_shell_command
([
"pyenv"
,
"which"
,
"python"
]),
shell
=
True
,
)
.
strip
()
)
env_manager
=
EnvManager
(
poetry
)
env_manager
=
EnvManager
(
poetry
)
env
=
env_manager
.
create_venv
(
io
)
env
=
env_manager
.
create_venv
(
io
,
executable
=
executable
)
if
env
.
is_venv
()
and
io
.
is_verbose
():
if
env
.
is_venv
()
and
io
.
is_verbose
():
io
.
write_line
(
f
"Using virtualenv: <comment>{env.path}</>"
)
io
.
write_line
(
f
"Using virtualenv: <comment>{env.path}</>"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment