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
e38c045c
Commit
e38c045c
authored
May 18, 2022
by
David Hotham
Committed by
Bjorn Neergaard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
partially restore temporary_directory()
Use the version from poetry.core always, one implementation is enough
parent
f897294a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
src/poetry/inspection/info.py
+2
-2
src/poetry/repositories/http.py
+4
-4
src/poetry/utils/env.py
+2
-2
No files found.
src/poetry/inspection/info.py
View file @
e38c045c
...
...
@@ -8,7 +8,6 @@ import tarfile
import
zipfile
from
pathlib
import
Path
from
tempfile
import
TemporaryDirectory
from
typing
import
TYPE_CHECKING
from
typing
import
Any
from
typing
import
Callable
...
...
@@ -23,6 +22,7 @@ from poetry.core.packages.dependency import Dependency
from
poetry.core.packages.package
import
Package
from
poetry.core.pyproject.toml
import
PyProjectTOML
from
poetry.core.utils.helpers
import
parse_requires
from
poetry.core.utils.helpers
import
temporary_directory
from
poetry.core.version.markers
import
InvalidMarker
from
poetry.utils.env
import
EnvCommandError
...
...
@@ -293,7 +293,7 @@ class PackageInfo:
context
=
tarfile
.
open
with
TemporaryD
irectory
()
as
tmp_str
:
with
temporary_d
irectory
()
as
tmp_str
:
tmp
=
Path
(
tmp_str
)
with
context
(
path
.
as_posix
())
as
archive
:
archive
.
extractall
(
tmp
.
as_posix
())
...
...
src/poetry/repositories/http.py
View file @
e38c045c
...
...
@@ -8,7 +8,6 @@ import urllib.parse
from
abc
import
ABC
from
collections
import
defaultdict
from
pathlib
import
Path
from
tempfile
import
TemporaryDirectory
from
typing
import
TYPE_CHECKING
from
typing
import
Any
...
...
@@ -17,6 +16,7 @@ import requests
from
poetry.core.packages.dependency
import
Dependency
from
poetry.core.packages.utils.link
import
Link
from
poetry.core.semver.helpers
import
parse_constraint
from
poetry.core.utils.helpers
import
temporary_directory
from
poetry.core.version.markers
import
parse_marker
from
poetry.repositories.cached
import
CachedRepository
...
...
@@ -87,7 +87,7 @@ class HTTPRepository(CachedRepository, ABC):
filename
=
os
.
path
.
basename
(
wheel_name
)
with
TemporaryD
irectory
()
as
temp_dir
:
with
temporary_d
irectory
()
as
temp_dir
:
filepath
=
Path
(
temp_dir
)
/
filename
self
.
_download
(
url
,
str
(
filepath
))
...
...
@@ -103,7 +103,7 @@ class HTTPRepository(CachedRepository, ABC):
filename
=
os
.
path
.
basename
(
sdist_name
)
with
TemporaryD
irectory
()
as
temp_dir
:
with
temporary_d
irectory
()
as
temp_dir
:
filepath
=
Path
(
temp_dir
)
/
filename
self
.
_download
(
url
,
str
(
filepath
))
...
...
@@ -232,7 +232,7 @@ class HTTPRepository(CachedRepository, ABC):
and
link
.
hash_name
not
in
(
"sha256"
,
"sha384"
,
"sha512"
)
and
hasattr
(
hashlib
,
link
.
hash_name
)
):
with
TemporaryD
irectory
()
as
temp_dir
:
with
temporary_d
irectory
()
as
temp_dir
:
filepath
=
Path
(
temp_dir
)
/
link
.
filename
self
.
_download
(
link
.
url
,
str
(
filepath
))
...
...
src/poetry/utils/env.py
View file @
e38c045c
...
...
@@ -16,7 +16,6 @@ from contextlib import contextmanager
from
copy
import
deepcopy
from
pathlib
import
Path
from
subprocess
import
CalledProcessError
from
tempfile
import
TemporaryDirectory
from
typing
import
TYPE_CHECKING
from
typing
import
Any
from
typing
import
Iterable
...
...
@@ -36,6 +35,7 @@ from poetry.core.poetry import Poetry
from
poetry.core.semver.helpers
import
parse_constraint
from
poetry.core.semver.version
import
Version
from
poetry.core.toml.file
import
TOMLFile
from
poetry.core.utils.helpers
import
temporary_directory
from
virtualenv.seed.wheels.embed
import
get_embed_wheel
from
poetry.locations
import
CACHE_DIR
...
...
@@ -1833,7 +1833,7 @@ def ephemeral_environment(
executable
:
str
|
Path
|
None
=
None
,
flags
:
dict
[
str
,
bool
]
=
None
,
)
->
Iterator
[
VirtualEnv
]:
with
TemporaryD
irectory
()
as
tmp_dir
:
with
temporary_d
irectory
()
as
tmp_dir
:
# TODO: cache PEP 517 build environment corresponding to each project venv
venv_dir
=
Path
(
tmp_dir
)
/
".venv"
EnvManager
.
build_venv
(
...
...
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