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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
import
zc.buildout
import
warnings
try
:
from
setuptools.wheel
import
Wheel
SETUPTOOLS_SUPPORTS_WHEELS
=
True
except
ImportError
:
SETUPTOOLS_SUPPORTS_WHEELS
=
False
warnings
.
filterwarnings
(
'ignore'
,
'.+is being parsed as a legacy, non PEP 440, version'
)
...
...
@@ -1619,29 +1625,23 @@ def unpack_egg(location, dest):
setuptools
.
archive_util
.
unpack_archive
(
location
,
dest
)
WHEEL_
TO_EGG_
WARNING
=
"""
Using unpack_wheel() shim over the deprecated wheel_to_egg() hook.
Please update your wheel extension implementation for one that installs a .wh
l
handler in %s.UNPACKERS
"""
.
strip
()
%
(
__name__
,)
WHEEL_WARNING
=
"""
*.whl file detected (%s), you'll need setuptools > 38.2.0 for that
or an extension like buildout.whee
l
"""
def
unpack_wheel
(
location
,
dest
):
# Deprecated backward compatibility shim. Please do not use.
logger
.
warning
(
WHEEL_TO_EGG_WARNING
)
basename
=
os
.
path
.
basename
(
location
)
dists
=
setuptools
.
package_index
.
distros_for_location
(
location
,
basename
)
# `wheel_to_egg()` might generate zipped eggs, so we have to make sure we
# 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
)
if
SETUPTOOLS_SUPPORTS_WHEELS
:
wheel
=
Wheel
(
location
)
wheel
.
install_as_egg
(
os
.
path
.
join
(
dest
,
wheel
.
egg_name
()))
else
:
logger
.
warning
(
WHEEL_WARNING
,
location
)
UNPACKERS
=
{
'.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