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
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
fb407634
Commit
fb407634
authored
Feb 13, 2017
by
Reinout van Rees
Committed by
GitHub
Feb 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #332 from buildout/wheel-hook
Added a hook to enable a soon-to-be-released buildout extension
parents
9c12d6a1
cc968ef8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
5 deletions
+58
-5
CHANGES.rst
CHANGES.rst
+3
-3
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+6
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+49
-2
No files found.
CHANGES.rst
View file @
fb407634
Change
History
**************
2.
7.2
(
unreleased
)
2.
8.0
(
unreleased
)
==================
-
Nothing
changed
yet
.
-
Added
a
hook
to
enable
a
soon
-
to
-
be
-
released
buildout
extension
to
provide
wheel
support
.
2.7.1
(
2017
-
01
-
31
)
==================
...
...
src/zc/buildout/easy_install.py
View file @
fb407634
...
...
@@ -83,6 +83,9 @@ setuptools_path = buildout_and_setuptools_path
FILE_SCHEME
=
re
.
compile
(
'file://'
,
re
.
I
).
match
DUNDER_FILE_PATTERN
=
re
.
compile
(
r"__file__ = '(?P<filename>.+)'$"
)
def
wheel_to_egg
(
dist
,
dest
):
raise
zc
.
buildout
.
UserError
(
"Wheels are not supported"
)
class
_Monkey
(
object
):
def
__init__
(
self
,
module
,
**
kw
):
mdict
=
self
.
_mdict
=
module
.
__dict__
...
...
@@ -513,6 +516,9 @@ class Installer:
raise
zc
.
buildout
.
UserError
(
"Couldn't download distribution %s."
%
avail
)
if
dist
.
location
.
endswith
(
'.whl'
):
dist
=
wheel_to_egg
(
dist
,
tmp
)
if
dist
.
precedence
==
pkg_resources
.
EGG_DIST
:
# It's already an egg, just fetch it into the dest
newloc
=
_move_to_eggs_dir_and_compile
(
dist
,
self
.
_dest
)
...
...
src/zc/buildout/tests.py
View file @
fb407634
...
...
@@ -3104,6 +3104,53 @@ def test_buildout_doesnt_keep_adding_itself_to_versions():
if
sys
.
platform
==
'win32'
:
del
buildout_honors_umask
# umask on dohs is academic
class
UnitTests
(
unittest
.
TestCase
):
@
property
def
globs
(
self
):
return
self
.
__dict__
def
setUp
(
self
):
easy_install_SetUp
(
self
)
import
setuptools.package_index
setuptools
.
package_index
.
EXTENSIONS
.
append
(
'.whl'
)
import
zc.buildout.easy_install
self
.
orig_wheel_to_egg
=
zc
.
buildout
.
easy_install
.
wheel_to_egg
def
tearDown
(
self
):
import
zc.buildout.easy_install
zc
.
buildout
.
testing
.
buildoutTearDown
(
self
)
import
setuptools.package_index
setuptools
.
package_index
.
EXTENSIONS
.
remove
(
'.whl'
)
zc
.
buildout
.
easy_install
.
wheel_to_egg
=
self
.
orig_wheel_to_egg
def
test_wheel_to_egg
(
self
):
[
egg_name
]
=
[
n
for
n
in
os
.
listdir
(
self
.
sample_eggs
)
if
n
.
startswith
(
'demo-0.3-'
)]
path
=
os
.
path
.
join
(
self
.
sample_eggs
,
egg_name
)
os
.
rename
(
path
,
os
.
path
.
join
(
self
.
sample_eggs
,
'demo-0.3.whl'
))
import
zc.buildout.easy_install
installer
=
zc
.
buildout
.
easy_install
.
Installer
(
os
.
path
.
join
(
self
.
sample_buildout
,
'eggs'
),
index
=
self
.
sample_eggs
)
# Can't install because the original hook is in place:
with
self
.
assertRaises
(
zc
.
buildout
.
UserError
):
installer
.
install
([
'demo'
])
def
wheel_to_egg
(
dist
,
dest
):
newloc
=
os
.
path
.
join
(
dest
,
egg_name
)
shutil
.
copy
(
dist
.
location
,
newloc
)
return
pkg_resources
.
Distribution
.
from_location
(
newloc
,
'demo-0.3.whl'
)
zc
.
buildout
.
easy_install
.
wheel_to_egg
=
wheel_to_egg
egg_dir
=
os
.
path
.
join
(
self
.
sample_buildout
,
'eggs'
)
self
.
assertFalse
(
egg_name
in
os
.
listdir
(
egg_dir
))
installer
.
install
([
'demo'
])
self
.
assertTrue
(
egg_name
in
os
.
listdir
(
egg_dir
))
######################################################################
def
create_sample_eggs
(
test
,
executable
=
sys
.
executable
):
...
...
@@ -3659,8 +3706,8 @@ def test_suite():
),
])
),
doctest.DocFileSuite(
'
testing_bugfix
.
txt
'
),
doctest.DocFileSuite(
'
testing_bugfix
.
txt
'),
unittest.makeSuite(UnitTests
),
]
# adding bootstrap.txt doctest to the suite
...
...
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