Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
4904f968
Commit
4904f968
authored
Dec 01, 2017
by
Reinout van Rees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using setuptools' wheel support directly
parent
f603b11d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+17
-17
No files found.
src/zc/buildout/easy_install.py
View file @
4904f968
...
@@ -37,6 +37,12 @@ import tempfile
...
@@ -37,6 +37,12 @@ import tempfile
import
zc.buildout
import
zc.buildout
import
warnings
import
warnings
try
:
from
setuptools.wheel
import
Wheel
SETUPTOOLS_SUPPORTS_WHEELS
=
True
except
ImportError
:
SETUPTOOLS_SUPPORTS_WHEELS
=
False
warnings
.
filterwarnings
(
warnings
.
filterwarnings
(
'ignore'
,
'.+is being parsed as a legacy, non PEP 440, version'
)
'ignore'
,
'.+is being parsed as a legacy, non PEP 440, version'
)
...
@@ -1619,29 +1625,23 @@ def unpack_egg(location, dest):
...
@@ -1619,29 +1625,23 @@ def unpack_egg(location, dest):
setuptools
.
archive_util
.
unpack_archive
(
location
,
dest
)
setuptools
.
archive_util
.
unpack_archive
(
location
,
dest
)
WHEEL_
TO_EGG_
WARNING
=
"""
WHEEL_WARNING
=
"""
Using unpack_wheel() shim over the deprecated wheel_to_egg() hook.
*.whl file detected (%s), you'll need setuptools > 38.2.0 for that
Please update your wheel extension implementation for one that installs a .wh
l
or an extension like buildout.whee
l
handler in %s.UNPACKERS
"""
"""
.
strip
()
%
(
__name__
,)
def
unpack_wheel
(
location
,
dest
):
def
unpack_wheel
(
location
,
dest
):
# Deprecated backward compatibility shim. Please do not use.
if
SETUPTOOLS_SUPPORTS_WHEELS
:
logger
.
warning
(
WHEEL_TO_EGG_WARNING
)
wheel
=
Wheel
(
location
)
basename
=
os
.
path
.
basename
(
location
)
wheel
.
install_as_egg
(
os
.
path
.
join
(
dest
,
wheel
.
egg_name
()))
dists
=
setuptools
.
package_index
.
distros_for_location
(
location
,
basename
)
else
:
# `wheel_to_egg()` might generate zipped eggs, so we have to make sure we
logger
.
warning
(
WHEEL_WARNING
,
location
)
# get unpacked eggs in the end:
tmp_dest
=
tempfile
.
mkdtemp
(
dir
=
dest
)
wheel_to_egg
(
list
(
dists
)[
0
],
tmp_dest
)
[
egg
]
=
glob
.
glob
(
os
.
path
.
join
(
tmp_dest
,
'*.egg'
))
unpack_egg
(
egg
,
dest
)
shutil
.
rmtree
(
tmp_dest
)
UNPACKERS
=
{
UNPACKERS
=
{
'.egg'
:
unpack_egg
,
'.egg'
:
unpack_egg
,
'.whl'
:
unpack_
egg
,
# Since 38.2, setuptools handles wheels, too.
'.whl'
:
unpack_
wheel
,
}
}
...
...
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