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
5073c205
Commit
5073c205
authored
Mar 27, 2021
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
env: align ephemeral environment interface to build
parent
b21dd144
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
poetry/inspection/info.py
+3
-1
poetry/utils/env.py
+8
-6
poetry/utils/pip.py
+1
-1
No files found.
poetry/inspection/info.py
View file @
5073c205
...
@@ -450,7 +450,9 @@ class PackageInfo:
...
@@ -450,7 +450,9 @@ class PackageInfo:
except
PackageInfoError
:
except
PackageInfoError
:
pass
pass
with
ephemeral_environment
(
pip
=
True
,
wheel
=
True
,
setuptools
=
True
)
as
venv
:
with
ephemeral_environment
(
with_pip
=
True
,
with_wheel
=
True
,
with_setuptools
=
True
)
as
venv
:
# TODO: cache PEP 517 build environment corresponding to each project venv
# TODO: cache PEP 517 build environment corresponding to each project venv
dest_dir
=
venv
.
path
.
parent
/
"dist"
dest_dir
=
venv
.
path
.
parent
/
"dist"
dest_dir
.
mkdir
()
dest_dir
.
mkdir
()
...
...
poetry/utils/env.py
View file @
5073c205
...
@@ -1464,9 +1464,10 @@ class NullEnv(SystemEnv):
...
@@ -1464,9 +1464,10 @@ class NullEnv(SystemEnv):
@contextmanager
@contextmanager
def
ephemeral_environment
(
def
ephemeral_environment
(
executable
=
None
,
executable
=
None
,
pip
:
bool
=
False
,
flags
:
Dict
[
str
,
bool
]
=
None
,
wheel
:
Optional
[
bool
]
=
None
,
with_pip
:
bool
=
False
,
setuptools
:
Optional
[
bool
]
=
None
,
with_wheel
:
Optional
[
bool
]
=
None
,
with_setuptools
:
Optional
[
bool
]
=
None
,
)
->
ContextManager
[
VirtualEnv
]:
)
->
ContextManager
[
VirtualEnv
]:
with
temporary_directory
()
as
tmp_dir
:
with
temporary_directory
()
as
tmp_dir
:
# TODO: cache PEP 517 build environment corresponding to each project venv
# TODO: cache PEP 517 build environment corresponding to each project venv
...
@@ -1474,9 +1475,10 @@ def ephemeral_environment(
...
@@ -1474,9 +1475,10 @@ def ephemeral_environment(
EnvManager
.
build_venv
(
EnvManager
.
build_venv
(
path
=
venv_dir
.
as_posix
(),
path
=
venv_dir
.
as_posix
(),
executable
=
executable
,
executable
=
executable
,
with_pip
=
pip
,
flags
=
flags
,
with_wheel
=
wheel
,
with_pip
=
with_pip
,
with_setuptools
=
setuptools
,
with_wheel
=
with_wheel
,
with_setuptools
=
with_setuptools
,
)
)
yield
VirtualEnv
(
venv_dir
,
venv_dir
)
yield
VirtualEnv
(
venv_dir
,
venv_dir
)
...
...
poetry/utils/pip.py
View file @
5073c205
...
@@ -47,7 +47,7 @@ def pip_install(
...
@@ -47,7 +47,7 @@ def pip_install(
# Under certain Python3.6 installs vendored pip wheel does not contain zip-safe
# Under certain Python3.6 installs vendored pip wheel does not contain zip-safe
# pep517 lib. In this cases we create an isolated ephemeral virtual environment.
# pep517 lib. In this cases we create an isolated ephemeral virtual environment.
with
ephemeral_environment
(
with
ephemeral_environment
(
executable
=
environment
.
python
,
pip
=
True
,
setuptools
=
True
executable
=
environment
.
python
,
with_pip
=
True
,
with_
setuptools
=
True
)
as
env
:
)
as
env
:
return
environment
.
run
(
return
environment
.
run
(
env
.
_bin
(
"pip"
),
env
.
_bin
(
"pip"
),
...
...
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